Weaknesses of type CWE-131

163 results

Cálculo incorreto do tamanho de buffer

O desenvolvedor calcula errado quantos bytes um buffer precisa armazenar, geralmente por erro de lógica matemática, confundindo unidades (bytes vs. elementos) ou não contando caracteres especiais como nulo terminador. Isso abre espaço para estouro de buffer quando dados maiores que o esperado são copiados para esse espaço insuficiente.

Example

Um programa aloca espaço para uma string com `malloc(strlen(entrada))` esquecendo o byte do nulo terminador; quando copia a string com `strcpy()`, escreve além dos limites alocados. Ou calcula `tamanho = num_elementos * 4` quando deveria ser `num_elementos * sizeof(tipo)`.

How to mitigate

Use funções seguras como `snprintf()` ou `strncpy()` que respeitam limites; valide o tamanho final antes de alocar memória; prefira bibliotecas de string seguras; implemente testes unitários que cubram casos-limite (strings vazias, máximo esperado, acima do máximo).

CVE-2026-27820LOWzlib: Buffer Overflow in Zlib::GzipReader ungetc via large input leads to memory corruptionEPSS 0.6%CVE-2023-52557HIGHOpenBSD 7.3 invalid l2tp message npppd crashEPSS 0.6%CVE-2026-29645HIGHNEMU (OpenXiangShan/NEMU) before v2025.12.r2 contains an improper instruction-validation flaw in its RISC-V Vector (RVV) decoder. The decodeEPSS 0.5%CVE-2024-23805HIGHF5 Application Visibility and Reporting module and BIG-IP Advanced WAF/ASM vulnerabilityEPSS 0.5%CVE-2026-1188MEDIUMIn the Eclipse OMR port library component since release 0.2.0, an API function to return the textual names of all supported processor featurEPSS 0.5%CVE-2024-45287CRITICALMultiple vulnerabilities in libnvEPSS 0.5%CVE-2025-66216CRITICALAIS-catcher has a Buffer Overflow vulnerability in `AIS::Message` leading to DoS/RCEEPSS 0.5%CVE-2022-41887MEDIUMOverflow in `tf.keras.losses.poisson` in TensorflowEPSS 0.5%CVE-2022-41907MEDIUMOverflow in `ResizeNearestNeighborGrad` in TensorflowEPSS 0.5%CVE-2022-41885MEDIUMOverflow in `FusedResizeAndPadConv2D` in TensorflowEPSS 0.5%CVE-2022-41886MEDIUMOverflow in `ImageProjectiveTransformV2` in TensorflowEPSS 0.5%CVE-2025-46723HIGHOpenVM byte decomposition of pc in AUIPC chip can overflowEPSS 0.5%CVE-2026-31970HIGHHTSlib BGZF index file reader has a heap buffer overflowEPSS 0.5%CVE-2023-1175HIGHIncorrect Calculation of Buffer Size in vim/vimEPSS 0.4%CVE-2025-30334HIGHOpenBSD wg(4) kernel crashEPSS 0.4%CVE-2024-49776MEDIUMA negative-size-param in tsMuxer version nightly-2024-04-05-01-53-02 allows attackers to cause Denial of Service (DoS) via a crafted TS videEPSS 0.4%CVE-2022-4378HIGHA stack overflow flaw was found in the Linux kernel's SYSCTL subsystem in how a user changes certain kernel parameters and variables. This fEPSS 0.4%CVE-2024-8361HIGHDoS caused due to wrong hash length returned for SHA2/224 algorithmEPSS 0.4%CVE-2026-45812MEDIUMApache NimBLE: OOB Read via sizeof(pointer) in Legacy Advertising Report HandlerEPSS 0.4%CVE-2020-14385MEDIUMA flaw was found in the Linux kernel before 5.9-rc4. A failure of the file system metadata validator in XFS can cause an inode with a valid,EPSS 0.4%