Executive brief
fast-uri is a URI parser library used by Node.js projects including Fastify and ajv. A flaw in its mailto scheme parser allows attackers to inject unintended email recipients, subjects, and body content by using percent-encoded field names that bypass validation checks but materialize after the URI is serialized. An application that validates an email's recipients before sending could silently add attacker-controlled recipients without detection.
Technical details
The vulnerability is an encoding/decoding desynchronization (CWE-172, CWE-436) in fast-uri versions 4.1.3 and 4.1.4's mailto parser. During parsing, the parser compares query field names (to, subject, body) while still percent-encoded, but only decodes them when storing generic headers. On serialization, decoded names are re-emitted as literals, so a percent-encoded reserved name like %74o (encoding "to") is not recognized as a recipient during parse() but becomes a literal "to=" field after serialize(). An attacker can inject multiple recipients or modify subject/body by percent-encoding these reserved names. The attack requires an application to parse an untrusted mailto URI, make a validation/allowlist decision on parse().to, then serialize and forward the result to a mail client or send path. The fix is available in fast-uri 4.1.5.
Affected products
- OpenJS Foundation fast-uri 4.1.3 to 4.1.4
Timeline
- 2026-09-15: disclosed: CVE-2026-86818 and GHSA-jvvf-x445-j334 published
- 2026-09-15: patched: fast-uri 4.1.5 released with fix