« Volver al listado

CVE-2022-41903

Estado: ModificadaCrítica (9.8)—

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=...`).

Leer descripción completaMostrar menos

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`.

CVSS

Probabilidad de explotación (EPSS)

EPSS (Exploit Prediction Scoring System, de FIRST) estima la probabilidad de que una vulnerabilidad sea explotada en 30 días. Complementa a CVSS (impacto) y a CISA KEV (explotación confirmada).

Tecnologías afectadas (1)

CWE

Referencias

JSON original (NVD)

Mostrar
{
  "id": "CVE-2022-41903",
  "cveTags": [],
  "metrics": {
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "id": "CVE-2022-41903",
          "role": "CISA Coordinator",
          "options": [
            {
              "exploitation": "none"
            },
            {
              "automatable": "yes"
            },
            {
              "technicalImpact": "total"
            }
          ],
          "version": "2.0.3",
          "timestamp": "2025-03-10T20:59:12.527761Z"
        }
      }
    ],
    "cvssMetricV31": [
      {
        "type": "Secondary",
        "source": "security-advisories@github.com",
        "cvssData": {
          "scope": "UNCHANGED",
          "version": "3.1",
          "baseScore": 9.8,
          "attackVector": "NETWORK",
          "baseSeverity": "CRITICAL",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
          "integrityImpact": "HIGH",
          "userInteraction": "NONE",
          "attackComplexity": "LOW",
          "availabilityImpact": "HIGH",
          "privilegesRequired": "NONE",
          "confidentialityImpact": "HIGH"
        },
        "impactScore": 5.9,
        "exploitabilityScore": 3.9
      },
      {
        "type": "Primary",
        "source": "nvd@nist.gov",
        "cvssData": {
          "scope": "UNCHANGED",
          "version": "3.1",
          "baseScore": 9.8,
          "attackVector": "NETWORK",
          "baseSeverity": "CRITICAL",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
          "integrityImpact": "HIGH",
          "userInteraction": "NONE",
          "attackComplexity": "LOW",
          "availabilityImpact": "HIGH",
          "privilegesRequired": "NONE",
          "confidentialityImpact": "HIGH"
        },
        "impactScore": 5.9,
        "exploitabilityScore": 3.9
      }
    ]
  },
  "affected": [
    {
      "source": "security-advisories@github.com",
      "affectedData": [
        {
          "vendor": "git",
          "product": "git",
          "versions": [
            {
              "status": "affected",
              "version": "< 2.30.7"
            },
            {
              "status": "affected",
              "version": ">= 2.31.0, < 2.31.6"
            },
            {
              "status": "affected",
              "version": ">= 2.32.0, < 2.32.5"
            },
            {
              "status": "affected",
              "version": ">= 2.33.0, < 2.33.6"
            },
            {
              "status": "affected",
              "version": ">= 2.34.0, < 2.34.6"
            },
            {
              "status": "affected",
              "version": ">= 2.35.0, < 2.35.6"
            },
            {
              "status": "affected",
              "version": ">= 2.36.0, < 2.36.4"
            },
            {
              "status": "affected",
              "version": ">= 2.37.0, < 2.37.5"
            },
            {
              "status": "affected",
              "version": ">= 2.38.0, < 2.38.3"
            },
            {
              "status": "affected",
              "version": "= 2.39.0"
            }
          ]
        }
      ]
    }
  ],
  "published": "2023-01-17T23:15:15.690",
  "references": [
    {
      "url": "https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#_export_subst",
      "tags": [
        "Vendor Advisory"
      ],
      "source": "security-advisories@github.com"
    },
    {
      "url": "https://git-scm.com/docs/pretty-formats#Documentation/pretty-formats.txt-emltltNgttruncltruncmtruncem",
      "tags": [
        "Vendor Advisory"
      ],
      "source": "security-advisories@github.com"
    },
    {
      "url": "https://github.com/git/git/commit/508386c6c5857b4faa2c3e491f422c98cc69ae76",
      "tags": [
        "Patch",
        "Release Notes",
        "Third Party Advisory"
      ],
      "source": "security-advisories@github.com"
    },
    {
      "url": "https://github.com/git/git/security/advisories/GHSA-475x-2q3q-hvwq",
      "tags": [
        "Third Party Advisory"
      ],
      "source": "security-advisories@github.com"
    },
    {
      "url": "https://security.gentoo.org/glsa/202312-15",
      "source": "security-advisories@github.com"
    },
    {
      "url": "https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#_export_subst",
      "tags": [
        "Vendor Advisory"
      ],
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    },
    {
      "url": "https://git-scm.com/docs/pretty-formats#Documentation/pretty-formats.txt-emltltNgttruncltruncmtruncem",
      "tags": [
        "Vendor Advisory"
      ],
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    },
    {
      "url": "https://github.com/git/git/commit/508386c6c5857b4faa2c3e491f422c98cc69ae76",
      "tags": [
        "Patch",
        "Release Notes",
        "Third Party Advisory"
      ],
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    },
    {
      "url": "https://github.com/git/git/security/advisories/GHSA-475x-2q3q-hvwq",
      "tags": [
        "Third Party Advisory"
      ],
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    },
    {
      "url": "https://security.gentoo.org/glsa/202312-15",
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    }
  ],
  "vulnStatus": "Modified",
  "weaknesses": [
    {
      "type": "Secondary",
      "source": "security-advisories@github.com",
      "description": [
        {
          "lang": "en",
          "value": "CWE-190"
        }
      ]
    }
  ],
  "descriptions": [
    {
      "lang": "en",
      "value": "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`."
    },
    {
      "lang": "es",
      "value": "Git es un sistema de control de revisiones distribuido. `git log` puede mostrar confirmaciones en un formato arbitrario usando sus especificadores `--format`. Esta funcionalidad también está expuesta a \"git archive\" a través del atributo git \"export-subst\". Al procesar los operadores de relleno, hay un desbordamiento de enteros en `pretty.c::format_and_pad_commit()` donde `size_t` se almacena incorrectamente como `int` y luego se agrega como un desplazamiento a `memcpy()`. Este desbordamiento puede ser desencadenado directamente por un usuario que ejecuta un comando que invoca la maquinaria de formato de commit (por ejemplo, `git log --format=...`). También se puede activar indirectamente a través del archivo git mediante el mecanismo export-subst, que expande los especificadores de formato dentro de los archivos dentro del repositorio durante un archivo git. Este desbordamiento de enteros puede dar lugar a escrituras arbitrarias en el almacenamiento dinámico, lo que puede dar lugar a la ejecución de código arbitrario. El problema ha sido solucionado en las versiones publicadas el 17-01-2023, remontándose a la v2.30.7. Se recomienda a los usuarios que actualicen. Los usuarios que no puedan actualizar deben desactivar \"git archive\" en repositorios que no sean de confianza. Si expone el archivo git a través de `git daemon`, desactívelo ejecutando `git config --global daemon.uploadArch false`."
    }
  ],
  "lastModified": "2026-06-17T05:04:01.900",
  "configurations": [
    {
      "nodes": [
        {
          "negate": false,
          "cpeMatch": [
            {
              "criteria": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "8D0B133C-FC2B-4CBF-8840-C85F6D650510",
              "versionEndIncluding": "2.30.6"
            },
            {
              "criteria": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "BA5113C4-D095-4E76-A6C6-F849E11DFA9D",
              "versionEndIncluding": "2.31.5",
              "versionStartIncluding": "2.31.0"
            },
            {
              "criteria": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "B82E8E87-1083-45B9-A273-E6AB31548D56",
              "versionEndIncluding": "2.32.4",
              "versionStartIncluding": "2.32.0"
            },
            {
              "criteria": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "C9162726-CACE-4CB9-ACDE-204655D6BB3B",
              "versionEndIncluding": "2.33.5",
              "versionStartIncluding": "2.33.0"
            },
            {
              "criteria": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "65D149AF-5604-4109-A60B-CB7B5BBBEE87",
              "versionEndIncluding": "2.34.5",
              "versionStartIncluding": "2.34.0"
            },
            {
              "criteria": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "383C057B-98D3-4AC6-9D43-AE13CC81FEC4",
              "versionEndIncluding": "2.35.5",
              "versionStartIncluding": "2.35.0"
            },
            {
              "criteria": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "7B191BB2-D3C9-440D-8F7F-237BE0CBDB96",
              "versionEndIncluding": "2.36.3",
              "versionStartIncluding": "2.36.0"
            },
            {
              "criteria": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "E3F7AE8C-A383-442C-8E74-7BC13E8B251D",
              "versionEndIncluding": "2.37.4",
              "versionStartIncluding": "2.37.0"
            },
            {
              "criteria": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "28F8851A-1566-4F16-AEC4-2C09AC866C2A",
              "versionEndIncluding": "2.38.2",
              "versionStartIncluding": "2.38.0"
            },
            {
              "criteria": "cpe:2.3:a:git-scm:git:2.39.0:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "CC98AC76-7F3E-45A0-9DE6-3D097CEE5199"
            }
          ],
          "operator": "OR"
        }
      ]
    }
  ],
  "sourceIdentifier": "security-advisories@github.com"
}