← voltar
CVE-2021-39178

XSS in Image Optimization API for Next.js versions between 10.0.0 and 11.1.0

CVSS 7.5 HIGHEPSS 1.1%CWE-79
Em resumo

Next.js versões 10.0.0 a 11.0.0 permitem que atacantes injetem código malicioso através de imagens SVG quando a API de otimização de imagens está configurada. Se um site permite que usuários enviem ou referenciem arquivos SVG de domínios configurados, atacantes podem executar JavaScript arbitrário nos navegadores dos visitantes.

Detalhe técnico

Vulnerabilidade de cross-site scripting (XSS) na API de Otimização de Imagens do Next.js versões 10.0.0–11.0.0. Requer: (1) `images.domains` configurado em next.config.js, (2) domínio permitindo SVGs fornecidos por usuários, e (3) uso do carregador padrão (não custom loader ou Vercel). Payloads SVG em parâmetros de imagem contornam sanitização, permitindo execução de scripts arbitrários.

Resumo gerado e traduzido por IA a partir da descrição oficial.
Next.js is a React framework. Versions of Next.js between 10.0.0 and 11.0.0 contain a cross-site scripting vulnerability. In order for an instance to be affected by the vulnerability, the `next.config.js` file must have `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 or the instance is deployed on Vercel, the instance is not affected by the vulnerability. The vulnerability is patched in Next.js version 11.1.1.
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
Produtos afetados
vercel · next.js

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

Falar com a TrueHacking →