CVE-2022-39390: Withdrawn Octocat.js Vulnerable To Code Injection Vulnerability

HIGH
Advisory Identifier: GHSA-r4jg-5v89-9v62
CWE-94 CWE-74
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2022-39390
GHSA Identifier GHSA-r4jg-5v89-9v62
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Withdrawn
Package Ecosystem npm
Published Date
Last Updated

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.

octocat.js fixed: 1.2
npm install octocat.js@1.2
Verify Direct and Transitive Dependencies

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

## Withdrawn This advisory has been withdrawn because it is a test. ## Original Description ### Impact Users can include their own images for accessories via provided URLs. These URLs are not validated and can result in execution of injected code. ### Patches This vulnerability was fixed in version 1.2 of octocat.js ### Workarounds Directly 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. ### References To render the file correctly, see documentation at `readme.md` ### For more information If you have any questions or comments about this advisory: * Open an issue in [the octo.js repository](http://github.com/octocademy/octocat.js/issues)

CVE-2022-39390 Affected Withdrawn Versions

1 component(s)
Fixed Versions:
1.2
Product / Package Ecosystem Affected Versions Fixed Version
octocat.js
npm
< 1.2
1.2

References

Frequently Asked Questions

What is CVE-2022-39390?
CVE-2022-39390 is a security vulnerability in Withdrawn involving Octocat.js vulnerable to code injection under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Withdrawn versions are affected?
Affected versions include releases prior to 1.2 across affected packages: octocat.js.
What version fixes CVE-2022-39390?
Upgrading to 1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is octocat.js affected?
Yes, octocat.js is affected in releases prior to 1.2. Upgrade your dependency to 1.2 or later.
What CWE is associated with CVE-2022-39390?
CVE-2022-39390 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (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.).
How can I check npm dependencies for CVE-2022-39390?
Run the dependency tree command: 'npm ls octocat.js'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}