# GHSA-x4hg-hfwf-p9mw: @asymmetric-effort/nogginlessdom vulnerable to ReDoS via user-controlled regex in HTMLInputElement pattern validation

- Severity: Medium (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-07-02T20:20:04.000Z
- Modified: 2026-09-10T03:50:53.053Z
- Weaknesses: CWE-1333

## Description

## Summary

The `HTMLInputElement.checkValidity()` method constructed a `RegExp` directly from the user-controlled `pattern` property without any sanitization or timeout protection. This allowed an attacker to inject a regex with catastrophic backtracking, freezing the event loop.

## Fix

Fixed in commit https://github.com/asymmetric-effort/NogginLessDom/commit/25a3cbac665fae5663f8b71c073b80c3152dbe7b on `main`. Added:
- Pattern length limit (1024 characters)
- Nested quantifier detection (`hasNestedQuantifiers`) that rejects patterns like `(a+)+` before constructing the regex
- Patterns exceeding limits are treated as non-matching (safe default)

(As written by GitHub Advisory Database.)

## Affected

- @asymmetric-effort/nogginlessdom (npm): before 0.0.22

## References

- <https://github.com/asymmetric-effort/NogginLessDom/security/advisories/GHSA-x4hg-hfwf-p9mw> (web)
- <https://github.com/asymmetric-effort/NogginLessDom/commit/25a3cbac665fae5663f8b71c073b80c3152dbe7b> (web)
- <https://github.com/asymmetric-effort/NogginLessDom> (package)

## Sources

- GitHub Advisory Database: [GHSA-x4hg-hfwf-p9mw](https://github.com/advisories/GHSA-x4hg-hfwf-p9mw), CC-BY-4.0, modified 2026-09-10

---

Page: https://cve.day/GHSA-x4hg-hfwf-p9mw · Whole record: https://cve.day/GHSA-x4hg-hfwf-p9mw.json · Rebuilt by cve.day 2026-11-25T22:56:46.963Z
