Vulnerabilities > CVE-2021-38185 - Integer Overflow or Wraparound vulnerability in GNU Cpio
Attack vector
LOCAL Attack complexity
LOW Privileges required
NONE Confidentiality impact
HIGH Integrity impact
HIGH Availability impact
HIGH Summary
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.
Vulnerable Configurations
Part | Description | Count |
---|---|---|
Application | 16 |
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Forced Integer Overflow This attack forces an integer variable to go out of range. The integer variable is often used as an offset such as size of memory allocation or similarly. The attacker would typically control the value of such variable and try to get it out of range. For instance the integer in question is incremented past the maximum possible value, it may wrap to become a very small, or negative number, therefore providing a very incorrect value which can lead to unexpected behavior. At worst the attacker can execute arbitrary code.
References
- https://github.com/fangqyi/cpiopwn
- https://lists.gnu.org/archive/html/bug-cpio/2021-08/msg00002.html
- https://lists.gnu.org/archive/html/bug-cpio/2021-08/msg00000.html
- https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dd96882877721703e19272fe25034560b794061b
- https://lists.debian.org/debian-lts-announce/2023/06/msg00007.html