CVE-2022-39390: Withdrawn Octocat.js Vulnerable To Code Injection Vulnerability
HIGHCVE-2022-39390 is a HIGH octocat.js vulnerable to code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Withdrawn libraries in the npm ecosystem. The issue involves octocat.js vulnerable to code injection. Remediation is available by upgrading affected packages to version 1.2.
CVE-2022-39390 at a Glance
How to Fix CVE-2022-39390
To remediate this vulnerability, upgrade all affected Withdrawn dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install octocat.js@1.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls octocat.js
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-39390, inspect your project dependencies using npm:
npm ls octocat.js
Analyze the terminal output to locate any version of Withdrawn in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2), your application is affected.
Note: The npm ls octocat.js command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Withdrawn, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-39390 Affected Withdrawn Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
octocat.js
|
npm |
< 1.2
|
1.2
|
References
Frequently Asked Questions
What is CVE-2022-39390?
Which Withdrawn versions are affected?
What version fixes CVE-2022-39390?
Is octocat.js affected?
What CWE is associated with CVE-2022-39390?
How can I check npm dependencies for CVE-2022-39390?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r4jg-5v89-9v62",
"modified" : "2022-11-09T22:35:46Z",
"published" : "2022-11-08T20:48:49Z",
"withdrawn" : "2022-11-09T22:35:46Z",
"aliases" : [ "CVE-2022-39390" ],
"summary" : "Withdrawn: Octocat.js vulnerable to code injection",
"details" : "## Withdrawn\n\nThis advisory has been withdrawn because it is a test.\n\n## Original Description\n\n### Impact\nUsers can include their own images for accessories via provided URLs. These URLs are not validated and can result in execution of injected code.\n\n### Patches\nThis vulnerability was fixed in version 1.2 of octocat.js\n\n### Workarounds\nDirectly exposing rendered images to a website can introduce the vulnerability to users. To avoid, writing an image to disk then using that image in an image element in HTML mitigates the risk.\n\n### References\nTo render the file correctly, see documentation at `readme.md`\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [the octo.js repository](http://github.com/octocademy/octocat.js/issues)\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "octocat.js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/octocademy/octocat.js/security/advisories/GHSA-r4jg-5v89-9v62"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39390"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/octocademy/octocat.js"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74", "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-11-08T20:48:49Z",
"nvd_published_at" : "2022-11-09T01:15:00Z"
}
}