Summary
Prototype pollution in jsii.configureCategories
jsii is a TypeScript to JavaScript compiler that also extracts an interface definition manifest to generate RPC stubs in various programming languages. jsii is typically used as a command-line tool, but it can also be loaded as a library.
When loaded as a library into a larger application, prototype pollution may happen if untrusted user input is passed to the library. When used as a command line-tool, this pollution cannot occur.
Workarounds
Sanitize user input to configureCategories() by stripping the proto property if detected.
References
If you have any questions or comments about this advisory, we ask that you contact AWS/Amazon Security via our issue reporting page [2] or directly via email to [email protected]. Please do not create a public GitHub issue.
[1] https://learn.snyk.io/lesson/prototype-pollution/
[2] https://aws.amazon.com/security/issue-reporting
Credits
We would like to thank Tariq Hawis for collaborating on this issue through the coordinated vulnerability disclosure process.
Impact
You may be impacted if you have written an application that loads jsii as a library, and passes untrusted user input into the jsii.configureCategories() function. In that case, a user can craft input in such a way that, following the invocation, a field named "category" with a user-controlled value is added to the JavaScript Object prototype. This will cause every object in the program (both new and existing) to have a field named "category", even if it shouldn't.
This will not affect jsii itself, but it might affect the application you have loaded jsii into.
The function jsii.configureCategories() is used to configure the severity (error, warning, etc.) of various jsii diagnostics.
Impacted versions: <=5.7.2, <=5.6.3, <=5.5.14, <=5.4.45
Example:
const jsii = require('jsii');
// prints 'undefined'
console.log(JSON.stringify({}.category))
// calling 'configureCategories' with user input
jsii.configureCategories(JSON.parse('{"__proto__": "user-input"}'))
// from this point onwards, every single object literal in the program
// will contain the 'category' key, with user controlled value
console.log(JSON.stringify({}.category)) // prints 'user-input'
// this can affect the execution of the main program in case it also makes
// use of an object key called 'category'. for example, if the main programs
// happens to have code like this:
const x = {} // some object in the main program (not necessarily empty)
if (x.category) {
// this block will always be executed, effectively
// changing the behavior of the main program.
console.log('Do something')
} else {
console.log('Do something else')
}
For more information about javascript prototype pollution, see [1].
GHSA-M56H-5XX3-2JC2 has a CVSS score of 3.7 (Low). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (5.7.3, 5.6.4, 5.5.15, 5.4.46); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Frequently Asked Questions
- What is GHSA-M56H-5XX3-2JC2? GHSA-M56H-5XX3-2JC2 is a low-severity security vulnerability in jsii (npm), affecting versions >= 5.7.0, < 5.7.3. It is fixed in 5.7.3, 5.6.4, 5.5.15, 5.4.46.
- How severe is GHSA-M56H-5XX3-2JC2? GHSA-M56H-5XX3-2JC2 has a CVSS score of 3.7 (Low). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of jsii are affected by GHSA-M56H-5XX3-2JC2? jsii (npm) versions >= 5.7.0, < 5.7.3 is affected.
- Is there a fix for GHSA-M56H-5XX3-2JC2? Yes. GHSA-M56H-5XX3-2JC2 is fixed in 5.7.3, 5.6.4, 5.5.15, 5.4.46. Upgrade to this version or later.
- Is GHSA-M56H-5XX3-2JC2 exploitable, and should I be worried? Whether GHSA-M56H-5XX3-2JC2 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-M56H-5XX3-2JC2 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-M56H-5XX3-2JC2?
- Upgrade
jsiito 5.7.3 or later - Upgrade
jsiito 5.6.4 or later - Upgrade
jsiito 5.5.15 or later - Upgrade
jsiito 5.4.46 or later
- Upgrade