VYPR
Low severity3.3NVD Advisory· Published Mar 22, 2026· Updated Apr 29, 2026

CVE-2026-4539

CVE-2026-4539

Description

A security flaw has been discovered in pygments up to 2.19.2. The impacted element is the function AdlLexer of the file pygments/lexers/archetype.py. The manipulation results in inefficient regular expression complexity. The attack is only possible with local access. The exploit has been released to the public and may be used for attacks. The project was informed of the problem early through an issue report but has not responded yet.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
PygmentsPyPI
< 2.20.02.20.0

Affected products

1

Patches

1
24b8aa76c6cd

fix(lexers): prevent ReDoS in archetype lexer GUID and ID patterns (#3064)

https://github.com/pygments/pygmentszam.Mar 25, 2026via ghsa
1 file changed · +3 3
  • pygments/lexers/archetype.py+3 3 modified
    @@ -35,8 +35,8 @@ class AtomsLexer(RegexLexer):
                 (r'([ \t]*)(--.*)$', bygroups(Whitespace, Comment)),
             ],
             'archetype_id': [
    -            (r'([ \t]*)(([a-zA-Z]\w+(\.[a-zA-Z]\w+)*::)?[a-zA-Z]\w+(-[a-zA-Z]\w+){2}'
    -             r'\.\w+[\w-]*\.v\d+(\.\d+){,2}((-[a-z]+)(\.\d+)?)?)',
    +            (r'([ \t]*)(([a-zA-Z]\w{1,100}(\.[a-zA-Z]\w{1,100})*::)?[a-zA-Z]\w{1,100}(-[a-zA-Z]\w{1,100}){2}'
    +             r'\.\w{1,100}[\w-]*\.v\d+(\.\d+){,2}((-[a-z]+)(\.\d+)?)?)',
                  bygroups(Whitespace, Name.Decorator)),
             ],
             'date_constraints': [
    @@ -293,7 +293,7 @@ class AdlLexer(AtomsLexer):
                 # numbers and version ids
                 (r'\d+(\.\d+)*', Literal),
                 # Guids
    -            (r'(\d|[a-fA-F])+(-(\d|[a-fA-F])+){3,}', Literal),
    +            (r'[0-9a-fA-F]{1,36}(-[0-9a-fA-F]{1,36}){3,}', Literal),
                 (r'\w+', Name.Class),
                 (r'"', String, 'string'),
                 (r'=', Operator),
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

9

News mentions

0

No linked articles in our index yet.