7.8high
GNU cpio through 2.13 allows attackers to execute arbitrary code via a crafted pattern file, because of a dstring.c dsfgetstr integer overf…
- Severity
- 7.8high CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 4.17% (higher than 91% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
Description
GNU cpio through 2.13 allows attackers to execute arbitrary code via a crafted pattern file, because of a dstring.c ds_fgetstr integer overflow that triggers an out-of-bounds heap write. NOTE: it is unclear whether there are common cases where the pattern file, associated with the -E option, is untrusted data.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| gnu cpio | up to 2.13 | NVD |
All scores
| CISA-ADP | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 6.8medium CVSS:2.0 | AV:N/AC:M/Au:N/C:P/I:P/A:P |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
GNU cpio through 2.13 allows attackers to execute arbitrary code via a crafted pattern file, because of a dstring.c ds_fgetstr integer overflow that triggers an out-of-bounds heap write. NOTE: it is unclear whether there are common cases where the pattern file, associated with the -E option, is untrusted data.
NVD (es)
GNU cpio versiones hasta 2.13, permite a atacantes ejecutar código arbitrario por medio de un archivo de patrones diseñado, debido a un desbordamiento de enteros en el archivo dstring.c en la función ds_fgetstr que desencadena una escritura de pila fuera de límites. NOTA: no está claro si hay casos comunes en los que el archivo de patrones, asociado con la opción -E, son datos no confiables
References
| https://github.com/fangqyi/cpiopwn | exploit, third-party-advisory | |
| https://lists.gnu.org/archive/html/bug-cpio/2021-08/msg00000.html | exploit, mailing-list, vendor-advisory | |
| https://lists.gnu.org/archive/html/bug-cpio/2021-08/msg00002.html | exploit, mailing-list, vendor-advisory | |
| https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dd96882877721703e19272fe25034560b794061b | patch, third-party-advisory | |
| https://lists.debian.org/debian-lts-announce/2023/06/msg00007.html | mailing-list | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-38185 changed 2025-06-09 | CVE Terms of Use |
| NVD | CVE-2021-38185 changed 2026-06-17 | Public domain |