{
  "threat_severity" : "Important",
  "public_date" : "2023-01-17T00:00:00Z",
  "bugzilla" : {
    "description" : "git: Heap overflow in `git archive`, `git log --format` leading to RCE",
    "id" : "2162056",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2162056"
  },
  "cvss3" : {
    "cvss3_base_score" : "9.8",
    "cvss3_scoring_vector" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
    "status" : "verified"
  },
  "cwe" : "CWE-190",
  "details" : [ "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 overflow can be triggered directly by a user running a command which invokes the commit formatting machinery (e.g., `git log --format=...`). It may also be triggered indirectly through git archive via the export-subst mechanism, which expands format specifiers inside of files within the repository during a git archive. This integer overflow can result in arbitrary heap writes, which may result in arbitrary 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. Users who are unable to upgrade should disable `git archive` in untrusted repositories. If you expose git archive via `git daemon`, disable it by running `git config --global daemon.uploadArch false`.", "A flaw was found in Git, a distributed revision control system. This issue occurs due to an 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 overflow can be triggered directly by a user running a command which invokes the commit formatting machinery (e.g., `git log --format=...`). It may also be triggered indirectly through the git archive via the export-subst mechanism, which expands format specifiers inside files within the repository during a git archive. This integer overflow can result in arbitrary heap writes, which may allow arbitrary code execution." ],
  "affected_release" : [ {
    "product_name" : "Red Hat Enterprise Linux 7",
    "release_date" : "2023-02-28T00:00:00Z",
    "advisory" : "RHSA-2023:0978",
    "cpe" : "cpe:/o:redhat:enterprise_linux:7",
    "package" : "git-0:1.8.3.1-24.el7_9"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8",
    "release_date" : "2023-02-06T00:00:00Z",
    "advisory" : "RHSA-2023:0610",
    "cpe" : "cpe:/a:redhat:enterprise_linux:8",
    "package" : "git-0:2.31.1-3.el8_7"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8.1 Update Services for SAP Solutions",
    "release_date" : "2023-02-06T00:00:00Z",
    "advisory" : "RHSA-2023:0599",
    "cpe" : "cpe:/a:redhat:rhel_e4s:8.1",
    "package" : "git-0:2.18.4-2.el8_1"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8.2 Advanced Update Support",
    "release_date" : "2023-02-06T00:00:00Z",
    "advisory" : "RHSA-2023:0609",
    "cpe" : "cpe:/a:redhat:rhel_aus:8.2",
    "package" : "git-0:2.18.4-3.el8_2"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8.2 Telecommunications Update Service",
    "release_date" : "2023-02-06T00:00:00Z",
    "advisory" : "RHSA-2023:0609",
    "cpe" : "cpe:/a:redhat:rhel_tus:8.2",
    "package" : "git-0:2.18.4-3.el8_2"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8.2 Update Services for SAP Solutions",
    "release_date" : "2023-02-06T00:00:00Z",
    "advisory" : "RHSA-2023:0609",
    "cpe" : "cpe:/a:redhat:rhel_e4s:8.2",
    "package" : "git-0:2.18.4-3.el8_2"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8.4 Extended Update Support",
    "release_date" : "2023-02-06T00:00:00Z",
    "advisory" : "RHSA-2023:0596",
    "cpe" : "cpe:/a:redhat:rhel_eus:8.4",
    "package" : "git-0:2.27.0-3.el8_4"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8.6 Extended Update Support",
    "release_date" : "2023-02-07T00:00:00Z",
    "advisory" : "RHSA-2023:0628",
    "cpe" : "cpe:/a:redhat:rhel_eus:8.6",
    "package" : "git-0:2.31.1-3.el8_6"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9",
    "release_date" : "2023-02-06T00:00:00Z",
    "advisory" : "RHSA-2023:0611",
    "cpe" : "cpe:/a:redhat:enterprise_linux:9",
    "package" : "git-0:2.31.1-3.el9_1"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9.0 Extended Update Support",
    "release_date" : "2023-02-07T00:00:00Z",
    "advisory" : "RHSA-2023:0627",
    "cpe" : "cpe:/a:redhat:rhel_eus:9.0",
    "package" : "git-0:2.31.1-3.el9_0"
  }, {
    "product_name" : "Red Hat Software Collections for Red Hat Enterprise Linux 7",
    "release_date" : "2023-02-06T00:00:00Z",
    "advisory" : "RHSA-2023:0597",
    "cpe" : "cpe:/a:redhat:rhel_software_collections:3::el7",
    "package" : "rh-git227-git-0:2.27.0-4.el7"
  }, {
    "product_name" : "Red Hat Virtualization 4 for Red Hat Enterprise Linux 8",
    "release_date" : "2023-04-10T00:00:00Z",
    "advisory" : "RHSA-2023:1677",
    "cpe" : "cpe:/o:redhat:rhev_hypervisor:4.4::el8",
    "package" : "redhat-virtualization-host-0:4.5.3-202304051438_8.6"
  } ],
  "package_state" : [ {
    "product_name" : "Red Hat Enterprise Linux 6",
    "fix_state" : "Out of support scope",
    "package_name" : "git",
    "cpe" : "cpe:/o:redhat:enterprise_linux:6"
  }, {
    "product_name" : "Red Hat JBoss Data Grid 7",
    "fix_state" : "Affected",
    "package_name" : "git",
    "cpe" : "cpe:/a:redhat:jboss_data_grid:7"
  } ],
  "references" : [ "https://www.cve.org/CVERecord?id=CVE-2022-41903\nhttps://nvd.nist.gov/vuln/detail/CVE-2022-41903\nhttps://github.com/git/git/files/10430260/X41-OSTIF-Gitlab-Git-Security-Audit-20230117-public.pdf\nhttps://github.com/git/git/security/advisories/GHSA-475x-2q3q-hvwq\nhttps://www.openwall.com/lists/oss-security/2023/01/17/4" ],
  "name" : "CVE-2022-41903",
  "csaw" : false
}