Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-mg2h-6x62-wpwc

Опубликовано: 18 апр. 2025
Источник: github
Github: Прошло ревью
CVSS3: 7.5

Описание

Fastify vulnerable to invalid content-type parsing, which could lead to validation bypass

Impact

In applications that specify different validation strategies for different content types, it's possible to bypass the validation by providing a slightly altered content type such as with different casing or altered whitespacing before ;.

Users using the the following pattern are affected:

fastify.post('/', { handler(request, reply) { reply.code(200).send(request.body) }, schema: { body: { content: { 'application/json': { schema: { type: 'object', properties: { 'foo': { type: 'string', } }, required: ['foo'] } }, } } } })

User using the following pattern are not affected:

fastify.post('/', { handler(request, reply) { reply.code(200).send(request.body) }, schema: { body: { type: 'object', properties: { 'foo': { type: 'string', } }, required: ['foo'] } } })

Patches

This was patched in v5.3.1, but unfortunately it did not cover all problems. This has been fully patched in v5.3.2. Version v4.9.0 was also affected by this issue. This has been fully patched in v4.9.1.

Workarounds

Do not specify multiple content types in the schema.

References

Are there any links users can visit to find out more?

https://hackerone.com/reports/3087928

Пакеты

Наименование

fastify

npm
Затронутые версииВерсия исправления

>= 5.0.0, <= 5.3.1

5.3.2

Наименование

fastify

npm
Затронутые версииВерсия исправления

= 4.29.0

4.29.1

EPSS

Процентиль: 26%
0.00089
Низкий

7.5 High

CVSS3

Дефекты

CWE-1287

Связанные уязвимости

CVSS3: 7.5
redhat
5 месяцев назад

Fastify is a fast and low overhead web framework, for Node.js. In versions 5.0.0 to 5.3.0 as well as version 4.29.0, applications that specify different validation strategies for different content types have a possibility to bypass validation by providing a _slightly altered_ content type such as with different casing or altered whitespacing before `;`. This was patched in v5.3.1, but the initial patch did not cover all problems. This has been fully patched in v5.3.2 and v4.29.1. A workaround involves not specifying individual content types in the schema.

CVSS3: 7.5
nvd
5 месяцев назад

Fastify is a fast and low overhead web framework, for Node.js. In versions 5.0.0 to 5.3.0 as well as version 4.29.0, applications that specify different validation strategies for different content types have a possibility to bypass validation by providing a _slightly altered_ content type such as with different casing or altered whitespacing before `;`. This was patched in v5.3.1, but the initial patch did not cover all problems. This has been fully patched in v5.3.2 and v4.29.1. A workaround involves not specifying individual content types in the schema.

EPSS

Процентиль: 26%
0.00089
Низкий

7.5 High

CVSS3

Дефекты

CWE-1287