Skip to content
Heist/ feed
Back to feed
HighFix available

py3-pygments — security advisory

Type: advisorySources: OSVAdvisory ID: ALPINE-CVE-2021-27291

In pygments 1.1+, fixed in 2.7.4, the lexers used to parse programming languages rely heavily on regular expressions. Some of the regular expressions have exponential or cubic worst-case complexity and are vulnerable to ReDoS. By crafting malicious input, an attacker can cause a denial of service.

Products
py3-pygments
Affected versions
Not specified
Fixed versions
2.5.2-r1, 2.6.1-r1
CVEs
CVE-2021-27291
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 22:03 UTC · Revision 1

Source evidence

ALPINE-CVE-2021-27291

core-osv · Original source

Published 17 Mar 2021, 13:15 UTC

In pygments 1.1+, fixed in 2.7.4, the lexers used to parse programming languages rely heavily on regular expressions. Some of the regular expressions have exponential or cubic worst-case complexity and are vulnerable to ReDoS. By crafting malicious input, an attacker can cause a denial of service.

osv:ALPINE-CVE-2021-27291

py3-pygments

Fixed versions: 2.5.2-r1

py3-pygments

Fixed versions: 2.6.1-r1

Complete source record
{
  "id": "08fd3c0adaf193e1756bd6fb0c64d478d41c5b94fb66f38472e02a4959576873",
  "url": "https://osv.dev/vulnerability/ALPINE-CVE-2021-27291",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "ALPINE-CVE-2021-27291",
    "summary": "In pygments 1.1+, fixed in 2.7.4, the lexers used to parse programming languages rely heavily on regular expressions. Some of the regular expressions have exponential or cubic worst-case complexity and are vulnerable to ReDoS. By crafting malicious input, an attacker can cause a denial of service.",
    "evidence": "osv:ALPINE-CVE-2021-27291",
    "products": [
      {
        "name": {
          "value": "py3-pygments",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.5.2-r1",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "py3-pygments",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.6.1-r1",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "ALPINE-CVE-2021-27291",
      "aliases": [
        "ALPINE-CVE-2021-27291"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.5.2-r1"
                }
              ]
            }
          ],
          "package": {
            "name": "py3-pygments",
            "purl": "pkg:apk/alpine/py3-pygments?arch=source",
            "ecosystem": "Alpine:v3.11"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-27291.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.6.1-r1"
                }
              ]
            }
          ],
          "package": {
            "name": "py3-pygments",
            "purl": "pkg:apk/alpine/py3-pygments?arch=source",
            "ecosystem": "Alpine:v3.12"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-27291.json"
          },
          "ecosystem_specific": {}
        }
      ],
      "modified": "2026-10-23T17:17:56.165537223Z",
      "provider": "osv",
      "upstream": [
        "CVE-2021-27291"
      ],
      "references": [
        "https://security.alpinelinux.org/vuln/CVE-2021-27291"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2021-27291",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 415366,
  "published_at": "2021-03-17T13:15:15.137+00:00"
}