node-opcua-client is vulnerable to prototype pollution via fieldsToJson()GHSA-cv5q-7543-48q4
LOWGHSA-cv5q-7543-48q4 is a low-severity (CVSS 3.7) CWE-1321 vulnerability in node-opcua-client. A fix is available for node-opcua-client — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for GHSA-cv5q-7543-48q4.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
node-opcua-client📦node-opcua-clientReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.
Description
Summary
A Prototype Pollution vulnerability exists in [email protected] due to an unsafe internal implementation of the fieldsToJson() function, which allows attackers to inject malicious properties into the global prototype chain via unsanitized field names.
Although CVE-2024-57086 addressed this issue in the node-opcua-alarm-condition package, this is a distinct vulnerability in node-opcua-client which implements its own fieldsToJson() logic.
Details
In [email protected], the internal file client_alarm.ts contains a method fieldsToJson() that performs direct assignments like:
output[field] = value;
PoC
import { fieldsToJson } from 'node-opcua-client/dist/alarms_and_conditions/client_alarm.js';
console.log("Before:", JSON.stringify({}.__proto__));
fieldsToJson(["__proto__.pollutedKey"], [{ value: { value: "pollutedValue" } }]);
console.log("After:", JSON.stringify({}.__proto__));
// Cleanup
delete Object.prototype.pollutedKey;
Impact
This vulnerability allows attackers to perform Prototype Pollution, which may lead to Denial of Service (DoS), logic corruption, or even arbitrary code execution if polluted keys reach sensitive paths. Applications that use node-opcua-client and expose user-controlled data to fieldsToJson() are at risk.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | node-opcua-client | ≥ 2.137.0&&< 2.139.0 | 2.139.0npm install node-opcua-client@2.139.0 |
| 📦npm | node-opcua-client | ≥ 2.144.0&&< 2.145.0 | 2.145.0npm install node-opcua-client@2.145.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for node-opcua-client, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update node-opcua-client to 2.139.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-cv5q-7543-48q4 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is GHSA-cv5q-7543-48q4 in your dependencies?
Find it across npm, including transitive dependencies.