GHSA-77mv-mp2j-gxxh: 3f/pygmentize Remote Code Execution Vulnerability

HIGH
CVSS 8.1
Published
Advisory Summary

GHSA-77mv-mp2j-gxxh is a HIGH (CVSS 8.1) remote code execution vulnerability (General Security Weakness) affecting 3f/pygmentize libraries in the Packagist ecosystem. The issue involves pygmentize remote code execution. Remediation is available by upgrading affected packages to version 1.2.

GHSA-77mv-mp2j-gxxh at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-77mv-mp2j-gxxh
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification General Security Weakness
Affected Product 3f/pygmentize
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-77mv-mp2j-gxxh

To remediate this vulnerability, upgrade all affected 3f/pygmentize dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

3f/pygmentize fixed: 1.2
Upgrade 3f/pygmentize to 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:

inspect dependencies for 3f/pygmentize

How to Check if You Are Affected

To determine whether your application is affected by GHSA-77mv-mp2j-gxxh, inspect your project dependencies for 3f/pygmentize:

inspect dependencies for 3f/pygmentize

Analyze the terminal output to locate any version of 3f/pygmentize 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: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In 3f/pygmentize, 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

pygmentize is prone to remote code execution due to an unsafe sanitazation of user input when passed to the `highlight` function.

GHSA-77mv-mp2j-gxxh Affected 3f/pygmentize Versions

1 component(s)
Fixed Versions:
1.2
Product / Package Ecosystem Affected Versions Fixed Version
3f/pygmentize
Packagist
< 1.2
1.2

References

Frequently Asked Questions

What is GHSA-77mv-mp2j-gxxh?
GHSA-77mv-mp2j-gxxh is a security vulnerability in 3f/pygmentize involving pygmentize Remote Code Execution under General Security Weakness.
Which 3f/pygmentize versions are affected?
Affected versions include releases prior to 1.2 across affected packages: 3f/pygmentize.
What version fixes GHSA-77mv-mp2j-gxxh?
Upgrading to 1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is 3f/pygmentize affected?
Yes, 3f/pygmentize is affected in releases prior to 1.2. Upgrade your dependency to 1.2 or later.
What is the CVSS score of GHSA-77mv-mp2j-gxxh?
GHSA-77mv-mp2j-gxxh has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with GHSA-77mv-mp2j-gxxh?
GHSA-77mv-mp2j-gxxh is classified under General Security Weakness.
How can I check Packagist dependencies for GHSA-77mv-mp2j-gxxh?
Run the dependency tree command: 'inspect dependencies for 3f/pygmentize'. 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-77mv-mp2j-gxxh",
  "modified" : "2024-05-15T17:36:47Z",
  "published" : "2024-05-15T17:36:47Z",
  "aliases" : [ ],
  "summary" : "pygmentize Remote Code Execution",
  "details" : "pygmentize is prone to remote code execution due to an unsafe sanitazation of user input when passed to the `highlight` function.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "3f/pygmentize"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dedalozzo/pygmentize/issues/1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dedalozzo/pygmentize/pull/3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/3f/pygmentize/2017-05-15.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dedalozzo/pygmentize"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-15T17:36:47Z",
    "nvd_published_at" : null
  }
}