CVE-2017-5954: Code Execution Through IIFE in serialize-to-js

serialize-to-js Updated 02 Oct 2025

Summary

18/07/2018
Yes i
Critical
9.8

CVE-2017-5954: Code Execution Through IIFE in serialize-to-js. Affects serialize-to-js versions < 1.0.0. Fixed in 1.0.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The serialize-to-js package is an npm package that provides serialization and deserialization functionality. It allows users to convert JavaScript objects into a string representation and vice versa. This package is commonly used in Node.js applications to transfer data between different systems or store it in a persistent format. However, versions of serialize-to-js prior to 1.0.0 are vulnerable to arbitrary code execution through an Immediately Invoked Function Expression (IIFE).

Vulnerability Detail

The vulnerability in serialize-to-js arises from a lack of proper input validation during deserialization. An attacker can craft a malicious payload that includes an IIFE, which will be executed when the payload is deserialized. This allows the attacker to execute arbitrary code within the context of the application. The impact of this vulnerability can be severe, as it can lead to remote code execution, unauthorized access, and data manipulation.

How To Fix

Minimum fixed version

1.0.0

This is the first release that contains the fix.

npm install serialize-to-js@1.0.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability. However, as a general best practice, it is recommended to avoid deserializing untrusted data or to implement strict input validation and sanitization when deserializing data from external sources.

Conclusion

The serialize-to-js package prior to version 1.0.0 is vulnerable to arbitrary code execution through an IIFE. To mitigate this vulnerability, it is crucial to update to the latest version of the package and follow best practices for input validation and data deserialization. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for serialize-to-js →

Share this vulnerability

FAQ

This vulnerability allows an attacker to execute arbitrary code within the context of the application, potentially leading to remote code execution, unauthorized access, and data manipulation.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. The Vulert Playground analyzes your package-lock.json file and provides real-time alerts for open-source vulnerabilities.

Yes, updating to version 1.0.0 or later of the serialize-to-js package fixes this vulnerability. It is recommended to review the package documentation for any additional considerations or guidance.

Implementing strict input validation and sanitization when deserializing data from external sources can help mitigate the risk of this vulnerability. Additionally, avoiding deserialization of untrusted data is a good practice.

Yes, this vulnerability can be exploited remotely if the application deserializes untrusted data from external sources. An attacker can craft a malicious payload and send it to the application, triggering the execution of arbitrary code.

Related vulnerabilities

Recent vulnerabilities recorded for serialize-to-js.

How To Fix

Minimum fixed version

1.0.0

This is the first release that contains the fix.

npm install serialize-to-js@1.0.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback