Every CVE Search/ Get API key

CVE-2026-18504

fastify vulnerable to schema validation bypass via root primitive coercion mismatch

5.4 MediumPublic exploitFix available

fastify is a fast and low overhead web framework for Node.js. Versions of fastify before 5.12.1 are affected by a schema validation bypass when a request body schema targets a root primitive value. When the schema validates a top-level primitive such as an integer, Ajv can coerce a JSON string into the expected type during validation, but Fastify does not replace the root request body with the coerced value, so the route handler receives the original unvalidated string. As a result, a request that should have failed validation can reach application logic with a value that does not satisfy the schema, which can undermine integrity and access-control checks that rely on the validated type. Users should upgrade to fastify 5.12.1, which fixes the mismatch. No known workarounds are available.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
Low
User interaction
None

What an attacker can affect

Confidentiality
Low
Integrity
Low
Availability
None

Exploit likelihood

0.28%Unchanged since Aug 19, 2026
90%50%10%1%

What each source reports

CVE List Score used 5.4

fastify vulnerable to schema validation bypass via root primitive coercion mismatch

fastify is a fast and low overhead web framework for Node.js. Versions of fastify before 5.12.1 are affected by a schema validation bypass when a request body schema targets a root primitive value. When the schema validates a top-level primitive such as an integer, Ajv can coerce a JSON string into the expected type during validation, but Fastify does not replace the root request body with the coerced value, so the route handler receives the original unvalidated string. As a result, a request that should have failed validation can reach application logic with a value that does not satisfy the schema, which can undermine integrity and access-control checks that rely on the validated type. Users should upgrade to fastify 5.12.1, which fixes the mismatch. No known workarounds are available.

Record
CVE-2026-18504
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Weakness
CWE-20
Updated
2026-11-02
EUVDEUVD-2026-61221 5.4

fastify is a fast and low overhead web framework for Node.js. Versions of fastify before 5.12.1 are affected by a schema validation bypass when a request body schema targets a root primitive value. When the schema validates a top-level primitive such as an integer, Ajv can coerce a JSON string into the expected type during validation, but Fastify does not replace the root request body with the coerced value, so the route handler receives the original unvalidated string. As a result, a request that should have failed validation can reach application logic with a value that does not satisfy the schema, which can undermine integrity and access-control checks that rely on the validated type. Users should upgrade to fastify 5.12.1, which fixes the mismatch. No known workarounds are available.

Record
EUVD-2026-61221
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-w2qp-rph6-63g4 5.4

fastify vulnerable to schema validation bypass via root primitive coercion mismatch

Impact

fastify before 5.12.1, when a route uses a root-level primitive body schema (for example an integer with a minimum and maximum) and the default type coercion, validates the coerced value but exposes the original, uncoerced value to the route handler. For example, a JSON body "10" is coerced to the number 10 and passes an integer 1 to 10 schema, but request.body stays the string "10". An application that trusts the validated type is handed a value that did not satisfy the schema, which can bypass limits the application enforces on that typed value. Object and array body schemas are not affected, they coerce their members in place.

Patches

Upgrade to fastify 5.12.1.

Workarounds

Until you can upgrade, avoid relying on the validated type of a root primitive body. Wrap the value in an object schema (object properties are coerced in place), for example accept { "value": 10 } and read request.body.value, or re-check the type in the handler.

Record
GHSA-w2qp-rph6-63g4
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Weakness
CWE-20
Updated
2026-11-02
NVD 5.4

fastify is a fast and low overhead web framework for Node.js. Versions of fastify before 5.12.1 are affected by a schema validation bypass when a request body schema targets a root primitive value. When the schema validates a top-level primitive such as an integer, Ajv can coerce a JSON string into the expected type during validation, but Fastify does not replace the root request body with the coerced value, so the route handler receives the original unvalidated string. As a result, a request that should have failed validation can reach application logic with a value that does not satisfy the schema, which can undermine integrity and access-control checks that rely on the validated type. Users should upgrade to fastify 5.12.1, which fixes the mismatch. No known workarounds are available.

Record
CVE-2026-18504
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-20
Updated
2026-11-02
OSV 5.4

fastify vulnerable to schema validation bypass via root primitive coercion mismatch

fastify is a fast and low overhead web framework for Node.js. Versions of fastify before 5.12.1 are affected by a schema validation bypass when a request body schema targets a root primitive value. When the schema validates a top-level primitive such as an integer, Ajv can coerce a JSON string into the expected type during validation, but Fastify does not replace the root request body with the coerced value, so the route handler receives the original unvalidated string. As a result, a request that should have failed validation can reach application logic with a value that does not satisfy the schema, which can undermine integrity and access-control checks that rely on the validated type. Users should upgrade to fastify 5.12.1, which fixes the mismatch. No known workarounds are available.

Record
CVE-2026-18504
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Weakness
CWE-20
Updated
2026-11-02
OSVGHSA-w2qp-rph6-63g4 5.4

fastify vulnerable to schema validation bypass via root primitive coercion mismatch

Impact

fastify before 5.12.1, when a route uses a root-level primitive body schema (for example an integer with a minimum and maximum) and the default type coercion, validates the coerced value but exposes the original, uncoerced value to the route handler. For example, a JSON body "10" is coerced to the number 10 and passes an integer 1 to 10 schema, but request.body stays the string "10". An application that trusts the validated type is handed a value that did not satisfy the schema, which can bypass limits the application enforces on that typed value. Object and array body schemas are not affected, they coerce their members in place.

Patches

Upgrade to fastify 5.12.1.

Workarounds

Until you can upgrade, avoid relying on the validated type of a root primitive body. Wrap the value in an object schema (object properties are coerced in place), for example accept { "value": 10 } and read request.body.value, or re-check the type in the handler.

Record
GHSA-w2qp-rph6-63g4
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Weakness
CWE-20
Updated
2026-11-02
Show 7 moreShow less
OSVCLSA-2026-1788431312 No score

TuxCare security update for fastify (1 CVE)

TuxCare rebuilt fastify to address 1 CVE. Fixed in 4.29.1-tuxcare.3.

Record
CLSA-2026-1788431312
Updated
2026-11-02
OSVCLSA-2026-1789755224 No score

TuxCare security update for fastify (2 CVEs)

TuxCare rebuilt fastify to address 2 CVEs. Fixed in 5.7.4-tuxcare.2.

Record
CLSA-2026-1789755224
Updated
2026-11-02
OSVCLSA-2026-1789896330 No score

TuxCare security update for fastify (2 CVEs)

TuxCare rebuilt fastify to address 2 CVEs. Fixed in 5.12.0-tuxcare.1.

Record
CLSA-2026-1789896330
Updated
2026-11-02
OSVCLSA-2026-1789896356 No score

TuxCare security update for fastify (1 CVE)

TuxCare rebuilt fastify to address 1 CVE. Fixed in 5.11.3-tuxcare.3.

Record
CLSA-2026-1789896356
Updated
2026-11-02
OSVCLSA-2026-1789906142 No score

TuxCare security update for fastify (3 CVEs)

TuxCare rebuilt fastify to address 3 CVEs. Fixed in 5.2.1-tuxcare.1.

Record
CLSA-2026-1789906142
Updated
2026-11-02
OSVCLSA-2026-1789917910 No score

TuxCare security update for fastify (1 CVE)

TuxCare rebuilt fastify to address 1 CVE. Fixed in 3.29.5-tuxcare.6.

Record
CLSA-2026-1789917910
Updated
2026-11-02
OSVCLSA-2026-1794060794 No score

TuxCare security update for fastify (6 CVEs)

TuxCare rebuilt fastify to address 6 CVEs. Fixed in 4.28.1-tuxcare.1.

Record
CLSA-2026-1794060794
Updated
2026-11-07

Affected products

Affected packages

Affected packages
PackageAffectedFixed
fastify
npm
before 5.12.1
5.12.1
fastify
TuxCare:npm
4.29.1-tuxcare.0 up to 4.29.1-tuxcare.3, plus listed versions
4.29.14.29.1-tuxcare.14.29.1-tuxcare.2
4.29.1-tuxcare.3
fastify
TuxCare:npm
From an advisory covering 2 CVEs
5.7.4-tuxcare.0 up to 5.7.4-tuxcare.2, plus listed versions
5.7.45.7.4-tuxcare.1
5.7.4-tuxcare.2
fastify
TuxCare:npm
From an advisory covering 2 CVEs
5.12.0-tuxcare.0 up to 5.12.0-tuxcare.1, plus listed versions
5.12.0
5.12.0-tuxcare.1
fastify
TuxCare:npm
5.11.3-tuxcare.0 up to 5.11.3-tuxcare.3, plus listed versions
5.11.35.11.3-tuxcare.15.11.3-tuxcare.2
5.11.3-tuxcare.3
fastify
TuxCare:npm
From an advisory covering 3 CVEs
5.2.1-tuxcare.0 up to 5.2.1-tuxcare.1, plus listed versions
5.2.1
5.2.1-tuxcare.1
fastify
TuxCare:npm
3.29.5-tuxcare.0 up to 3.29.5-tuxcare.6, plus listed versions
3.29.53.29.5-tuxcare.13.29.5-tuxcare.23.29.5-tuxcare.33.29.5-tuxcare.43.29.5-tuxcare.5
3.29.5-tuxcare.6
fastify
TuxCare:npm
From an advisory covering 6 CVEs
4.28.1-tuxcare.0 up to 4.28.1-tuxcare.1, plus listed versions
4.28.1
4.28.1-tuxcare.1

Public exploits

Links only. Every CVE stores no exploit code.

Public exploits
SourceLinkDate
PoC in GitHubHORKimhab/CVE-2026-18504-CVE-2026-167322026-08-19

History

History
RecordedChangedSources
affected, aliasesOSV
affected, facts
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV, PoC in GitHub

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-18504 is a medium vulnerability (CVSS 5.4) in @clerk Fastify, published August 18, 2026. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.28%, the 20th percentile. Fixed in fastify 5.12.1.

References

MoveEnter Open