Fastify's Missing End Anchor in "subtypeNameReg" Allows Malformed Content-Types to Pass Validation
Fastify incorrectly accepts malformed `Content-Type` headers containing trailing characters after the subtype token, in violation of RFC 9110 §8.3.1(https://httpwg.org/specs/rfc9110.html#field.content-type). For example, a request sent with Content-Type: application/json garbage passes validation and is processed normally, rather than being rejected with 415 Unsupported Media Type. When regex-based content-type parsers are in use (a documented Fastify feature), the malformed value is matched against registered parsers using the full string including the trailing garbage. This means a request with an invalid content-type may be routed to and processed by a parser it should never have reached. Impact: An attacker can send requests with RFC-invalid Content-Type headers that bypass validity checks, reach content-type parser matching, and be processed by the server. Requests that should be rejected at the validation stage are instead handled as if the content-type were valid. Workarounds: Deploy a WAF rule to protect against this Fix: The fix is available starting with v5.8.1.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-3419
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 17:48 UTC · Revision 1
Source evidence
Fastify's Missing End Anchor in "subtypeNameReg" Allows Malformed Content-Types to Pass Validation
core-osv · Original sourcePublished 6 Mar 2026, 17:50 UTC
Fastify incorrectly accepts malformed `Content-Type` headers containing trailing characters after the subtype token, in violation of RFC 9110 §8.3.1(https://httpwg.org/specs/rfc9110.html#field.content-type). For example, a request sent with Content-Type: application/json garbage passes validation and is processed normally, rather than being rejected with 415 Unsupported Media Type. When regex-based content-type parsers are in use (a documented Fastify feature), the malformed value is matched against registered parsers using the full string including the trailing garbage. This means a request with an invalid content-type may be routed to and processed by a parser it should never have reached. Impact: An attacker can send requests with RFC-invalid Content-Type headers that bypass validity checks, reach content-type parser matching, and be processed by the server. Requests that should be rejected at the validation stage are instead handled as if the content-type were valid. Workarounds: Deploy a WAF rule to protect against this Fix: The fix is available starting with v5.8.1.
osv:CVE-2026-3419
Complete source record
{
"id": "5831f21a5e05b3faac48aeca2b1006f8cd7b69e33b554ff8fa1004363d754d97",
"url": "https://osv.dev/vulnerability/CVE-2026-3419",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Fastify's Missing End Anchor in \"subtypeNameReg\" Allows Malformed Content-Types to Pass Validation",
"summary": "Fastify incorrectly accepts malformed `Content-Type` headers containing trailing characters after the subtype token, in violation of RFC 9110 §8.3.1(https://httpwg.org/specs/rfc9110.html#field.content-type). For example, a request sent with Content-Type: application/json garbage passes validation and is processed normally, rather than being rejected with 415 Unsupported Media Type. When regex-based content-type parsers are in use (a documented Fastify feature), the malformed value is matched against registered parsers using the full string including the trailing garbage. This means a request with an invalid content-type may be routed to and processed by a parser it should never have reached. Impact: An attacker can send requests with RFC-invalid Content-Type headers that bypass validity checks, reach content-type parser matching, and be processed by the server. Requests that should be rejected at the validation stage are instead handled as if the content-type were valid. Workarounds: Deploy a WAF rule to protect against this Fix: The fix is available starting with v5.8.1.",
"evidence": "osv:CVE-2026-3419",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2026-3419",
"aliases": [
"CVE-2026-3419",
"GHSA-573f-x89g-hqp9"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/fastify/fastify",
"type": "GIT",
"events": [
{
"introduced": "e1e4fe75910c36e1b9ebb87026ca16c053a9c1f2"
},
{
"fixed": "073ff8132f350aaa53935231019499e983cb9794"
},
{
"fixed": "67f6c9b32cb3623d3c9470cc17ed830dd2f083d7"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:fastify:fastify:*:*:*:*:*:node.js:*:*",
"range": [
{
"introduced": "5.7.2"
},
{
"fixed": "5.8.1"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "67f6c9b32cb3623d3c9470cc17ed830dd2f083d7"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"v5.8.0",
"v5.7.4",
"v5.7.3",
"v5.7.2"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-3419.json"
}
}
],
"modified": "2026-10-28T02:30:31.051888989Z",
"provider": "osv",
"references": [
"https://httpwg.org/specs/rfc9110.html#field.content-type",
"https://www.cve.org/CVERecord?id=CVE-2026-3419",
"https://cna.openjsf.org/security-advisories.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/3xxx/CVE-2026-3419.json",
"https://github.com/advisories/GHSA-573f-x89g-hqp9",
"https://github.com/fastify/fastify/security/advisories/GHSA-573f-x89g-hqp9",
"https://nvd.nist.gov/vuln/detail/CVE-2026-3419",
"https://github.com/fastify/fastify/commit/67f6c9b32cb3623d3c9470cc17ed830dd2f083d7"
],
"provider_metadata": {
"cwe_ids": [
"CWE-185"
],
"cna_assigner": "openjs",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/3xxx/CVE-2026-3419.json"
}
},
"related_cves": [
{
"value": "CVE-2026-3419",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 498002,
"published_at": "2026-03-06T17:50:58.714+00:00"
}