← voltar
CVE-2022-23646

Improper CSP in Image Optimization API for Next.js

CVSS 5.9 MEDIUMEPSS 1.8%CWE-451
Em resumo

O Next.js nas versões 10.0.0 até 12.0.x tem uma falha na otimização de imagens que permite burlar proteções de segurança (CSP) quando SVGs são usados. Isso pode permitir que código malicioso execute nos navegadores dos usuários se o domínio de imagens aceitar SVGs enviados por usuários.

Detalhe técnico

Existe um bypass de Content Security Policy (CSP) na API de Image Optimization do Next.js quando `images.domains` está configurado com hosts que permitem upload de SVG fornecidos por usuários e o carregador de imagem padrão é utilizado. Um atacante pode criar conteúdo SVG malicioso que contorna restrições de CSP, potencialmente levando a ataques de execução de script entre sites (XSS). A mitigação requer atualizar para a versão 12.1.0 ou configurar um `loader` não-padrão em `next.config.js`.

Resumo gerado e traduzido por IA a partir da descrição oficial.
Next.js is a React framework. Starting with version 10.0.0 and prior to version 12.1.0, Next.js is vulnerable to User Interface (UI) Misrepresentation of Critical Information. In order to be affected, the `next.config.js` file must have an `images.domains` array assigned and the image host assigned in `images.domains` must allow user-provided SVG. If the `next.config.js` file has `images.loader` assigned to something other than default, the instance is not affected. Version 12.1.0 contains a patch for this issue. As a workaround, change `next.config.js` to use a different `loader configuration` other than the default.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Produtos afetados
vercel · next.js

Quer saber se a sua infraestrutura está exposta a isto?

Falar com a TrueHacking →