QID 354718

Date Published: 2023-02-07

QID 354718: Amazon Linux Security Advisory for git : ALAS-2023-1679

git is distributed revision control system.
Gitattributes are a mechanism to allow defining attributes for paths.
These attributes can be defined by adding a `.gitattributes` file to the repository, which contains a set of file patterns and the attributes that should be set for paths matching this pattern.
When parsing gitattributes, multiple integer overflows can occur when there is a huge number of path patterns, a huge number of attributes for a single pattern, or when the declared attribute names are huge.
These overflows can be triggered via a crafted `.gitattributes` file that may be part of the commit history.
Git silently splits lines longer than 2kb when parsing gitattributes from a file, but not when parsing them from the index.
Consequentially, the failure mode depends on whether the file exists in the working tree, the index or both.
This integer overflow can result in arbitrary heap reads and writes, which may result in remote code execution.
The problem has been patched in the versions published on 2023-01-17, going back to v2.30.7.
Users are advised to upgrade.
There are no known workarounds for this issue. (
( CVE-2022-23521) git is distributed revision control system.
`git log` can display commits in an arbitrary format using its `--format` specifiers.
This functionality is also exposed to `git archive` via the `export-subst` gitattribute.
When processing the padding operators, there is a integer overflow in `pretty.c::format_and_pad_commit()` where a `size_t` is stored improperly as an `int`, and then added as an offset to a `memcpy()`.
This integer overflow can result in arbitrary heap writes, which may result in arbitrary code execution.

Note: The preceding description block is extracted directly from the security advisory. Using automation, we have attempted to clean and format it as much as possible without introducing additional issues.

Successful exploitation of this vulnerability could lead to a securitybreach or could affect integrity, availability, and confidentiality.

  • CVSS V3 rated as Critical - 9.8 severity.
  • CVSS V2 rated as Medium - 5.4 severity.
  • Solution
    Please refer to Amazon advisory: ALAS-2023-1679 for affected packages and patching details, or update with your package manager.
    Vendor References

    CVEs related to QID 354718

    Software Advisories
    Advisory ID Software Component Link
    ALAS-2023-1679 amazon linux URL Logo alas.aws.amazon.com/ALAS-2023-1679.html