Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-109563 Overview
CVE-2026-109563 is a regular expression denial of service (ReDoS) vulnerability in N3.js, a JavaScript library for parsing RDF data in Turtle and N3 formats. Versions before 2.11.1 contain a flawed numeric literal pattern in the N3Lexer component that exhibits quadratic backtracking when processing long runs of digits that do not form a valid number. Attackers can submit crafted Turtle or N3 input to block the Node.js event loop, causing the parser to hang and preventing further request processing. The weakness is tracked as CWE-1333 (Inefficient Regular Expression Complexity).
Critical Impact
Unauthenticated attackers can send malicious RDF payloads over the network to exhaust CPU and freeze the Node.js event loop, resulting in denial of service for any application that parses untrusted Turtle or N3 input.
Affected Products
- N3.js versions prior to 2.11.1
- Node.js applications parsing untrusted Turtle input using N3.js
- Node.js applications parsing untrusted N3 input using N3.js
Discovery Timeline
- 2026-10-12 - CVE-2026-109563 published to NVD
- 2026-10-14 - Last updated in NVD database
Technical Details for CVE-2026-109563
Vulnerability Analysis
The vulnerability resides in the _number regular expression inside src/N3Lexer.js. The pattern was intended to match signed integers, decimals, and scientific-notation numbers used as RDF literals in Turtle and N3 documents. Its structure allowed the regex engine to explore overlapping match paths when a long sequence of digits failed the terminating lookahead, producing time complexity that grows quadratically with the length of the digit run.
Because N3.js runs synchronously inside the Node.js event loop, a single parse of a crafted document consumes a CPU core and blocks all other requests on the same process. The parser does not require authentication or special privileges, and the attack vector is network-reachable wherever an application accepts user-supplied RDF data. The related BASE_UNSUPPORTED and SUFFIX_SUPPORTED IRI patterns in src/BaseIRI.js exhibited similar superlinear behavior and were corrected in the same release.
Root Cause
The original _number regex, /^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:!\^\s#()\[\]\{\}"'<>])/, combined ambiguous \d* and \d+ segments with a trailing lookahead for a terminating character. When the lookahead failed on a long digit run, the engine backtracked across multiple ways to split those digits between the inner and outer quantifiers, generating quadratic work.
Attack Vector
An attacker submits a Turtle or N3 document containing a long run of digits (for example, within an object literal) that is not followed by a valid number terminator. Any HTTP endpoint, message queue consumer, or file ingestion pipeline that passes untrusted RDF to N3.js is reachable. Parsing a single payload is sufficient to stall the Node.js process.
// Vulnerable pattern (before patch) and fixed pattern (after patch)
// Source: https://github.com/rdfjs/N3.js/commit/b1c497fddb02c4772d61916bd2634115f45f424d
// BEFORE (vulnerable - quadratic backtracking on long digit runs):
this._number = /^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:!\^\s#()\[\]\{\}"'<>])/;
// AFTER (fixed - linear matching with anchored lookahead):
this._number = /^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?\d+|(?=\.?\d)\d*(?:(\.)\d+)?)(?=\.?[,;:!\^\s#()\[\]\{\}"'<>])/;
The fix anchors the exponent branch with \d+, uses a leading lookahead (?=\.?\d) to commit to the integer branch only when digits exist, and removes the trailing \d+ that previously overlapped with \d*. These changes eliminate the ambiguous paths that caused backtracking.
Detection Methods for CVE-2026-109563
Indicators of Compromise
- Node.js worker processes pinned at 100% CPU on a single core while parsing RDF input
- Request timeouts or health check failures on services that ingest Turtle or N3 documents
- Inbound payloads containing unusually long contiguous digit sequences (hundreds or thousands of digits) in RDF literal positions
- Growing event loop lag metrics (process.nextTick delays, perf_hooks monitorEventLoopDelay spikes) correlated with RDF parsing activity
Detection Strategies
- Inventory Node.js services that depend on n3 using npm ls n3 or software composition analysis, and flag versions below 2.11.1
- Instrument RDF parsing paths with timeouts and record payload length, source IP, and parse duration for correlation
- Add web application firewall rules that inspect request bodies for abnormally long numeric sequences outside expected ranges in RDF content types (text/turtle, application/n-triples, text/n3)
Monitoring Recommendations
- Enable Node.js event loop delay monitoring and alert when p95 latency exceeds normal baselines during RDF ingestion
- Track per-endpoint parse latency distributions and alert on tail latency growth that indicates algorithmic abuse
- Forward application and reverse proxy logs to a centralized analytics platform to correlate CPU spikes with specific inbound payloads
How to Mitigate CVE-2026-109563
Immediate Actions Required
- Upgrade N3.js to version 2.11.1 or later in all affected Node.js services
- Audit dependency trees for transitive uses of n3 and rebuild downstream packages that pin an older version
- Apply request size limits and parse timeouts on any endpoint that accepts Turtle or N3 input
- Restrict RDF ingestion endpoints to authenticated clients where business requirements allow
Patch Information
The fix is included in N3.js 2.11.1 and is implemented by commit b1c497f, merged via pull request #760. The patch rewrites the _number, _prefixed, _variable, and SUFFIX_SUPPORTED regular expressions to run in linear time. Additional context is available in the VulnCheck advisory and the N3.js repository.
Workarounds
- Enforce a maximum payload size on RDF inputs sufficient to reject documents containing excessively long digit runs
- Wrap N3.Parser invocations in a worker thread or child process with a hard execution timeout so that a stalled parse can be killed without affecting the main event loop
- Reject requests whose Content-Type indicates RDF but whose body contains contiguous digit sequences beyond a sane threshold (for example, 64 characters)
# Upgrade N3.js to the patched release in affected projects
npm install n3@^2.11.1
# Verify the installed version no longer matches the vulnerable range
npm ls n3
# Audit the project for known advisories after upgrade
npm audit --production
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

