« Volver al listado

CVE-2022-41720

Estado: ModificadaAlta (7.5)—

On Windows, restricted files can be accessed via os.DirFS and http.Dir. The os.DirFS function and http.Dir type provide access to a tree of files rooted at a given directory. These functions permit access to Windows device files under that root. For example, os.DirFS("C:/tmp").Open("COM1") opens the COM1 device. Both os.DirFS and http.Dir only provide read-only filesystem access. In addition, on Windows, an os.DirFS for the directory (the root of the current drive) can permit a maliciously crafted path to escape from the drive and access any path on the system. With fix applied, the behavior of os.DirFS("") has changed. Previously, an empty root was treated equivalently to "/", so os.DirFS("").Open("tmp") would open the path "/tmp". This now returns an error.

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-41720",
  "cveTags": [],
  "metrics": {
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "id": "CVE-2022-41720",
          "role": "CISA Coordinator",
          "options": [
            {
              "exploitation": "none"
            },
            {
              "automatable": "yes"
            },
            {
              "technicalImpact": "partial"
            }
          ],
          "version": "2.0.3",
          "timestamp": "2025-04-23T15:41:16.852650Z"
        }
      }
    ],
    "cvssMetricV31": [
      {
        "type": "Primary",
        "source": "nvd@nist.gov",
        "cvssData": {
          "scope": "UNCHANGED",
          "version": "3.1",
          "baseScore": 7.5,
          "attackVector": "NETWORK",
          "baseSeverity": "HIGH",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
          "integrityImpact": "NONE",
          "userInteraction": "NONE",
          "attackComplexity": "LOW",
          "availabilityImpact": "NONE",
          "privilegesRequired": "NONE",
          "confidentialityImpact": "HIGH"
        },
        "impactScore": 3.6,
        "exploitabilityScore": 3.9
      },
      {
        "type": "Secondary",
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "cvssData": {
          "scope": "UNCHANGED",
          "version": "3.1",
          "baseScore": 7.5,
          "attackVector": "NETWORK",
          "baseSeverity": "HIGH",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
          "integrityImpact": "NONE",
          "userInteraction": "NONE",
          "attackComplexity": "LOW",
          "availabilityImpact": "NONE",
          "privilegesRequired": "NONE",
          "confidentialityImpact": "HIGH"
        },
        "impactScore": 3.6,
        "exploitabilityScore": 3.9
      }
    ]
  },
  "affected": [
    {
      "source": "security@golang.org",
      "affectedData": [
        {
          "vendor": "Go standard library",
          "product": "os",
          "versions": [
            {
              "status": "affected",
              "version": "0",
              "lessThan": "1.18.9",
              "versionType": "semver"
            },
            {
              "status": "affected",
              "version": "1.19.0-0",
              "lessThan": "1.19.4",
              "versionType": "semver"
            }
          ],
          "platforms": [
            "windows"
          ],
          "packageName": "os",
          "collectionURL": "https://pkg.go.dev",
          "defaultStatus": "unaffected",
          "programRoutines": [
            {
              "name": "dirFS.Open"
            },
            {
              "name": "dirFS.Stat"
            },
            {
              "name": "DirFS"
            }
          ]
        },
        {
          "vendor": "Go standard library",
          "product": "net/http",
          "versions": [
            {
              "status": "affected",
              "version": "0",
              "lessThan": "1.18.9",
              "versionType": "semver"
            },
            {
              "status": "affected",
              "version": "1.19.0-0",
              "lessThan": "1.19.4",
              "versionType": "semver"
            }
          ],
          "platforms": [
            "windows"
          ],
          "packageName": "net/http",
          "collectionURL": "https://pkg.go.dev",
          "defaultStatus": "unaffected",
          "programRoutines": [
            {
              "name": "Dir.Open"
            },
            {
              "name": "ServeFile"
            },
            {
              "name": "fileHandler.ServeHTTP"
            },
            {
              "name": "fileTransport.RoundTrip"
            }
          ]
        }
      ]
    }
  ],
  "published": "2022-12-07T17:15:10.293",
  "references": [
    {
      "url": "https://go.dev/cl/455716",
      "tags": [
        "Patch",
        "Vendor Advisory"
      ],
      "source": "security@golang.org"
    },
    {
      "url": "https://go.dev/issue/56694",
      "tags": [
        "Issue Tracking",
        "Vendor Advisory"
      ],
      "source": "security@golang.org"
    },
    {
      "url": "https://groups.google.com/g/golang-announce/c/L_3rmdT0BMU/m/yZDrXjIiBQAJ",
      "tags": [
        "Patch",
        "Release Notes",
        "Third Party Advisory"
      ],
      "source": "security@golang.org"
    },
    {
      "url": "https://pkg.go.dev/vuln/GO-2022-1143",
      "tags": [
        "Patch",
        "Vendor Advisory"
      ],
      "source": "security@golang.org"
    },
    {
      "url": "https://go.dev/cl/455716",
      "tags": [
        "Patch",
        "Vendor Advisory"
      ],
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    },
    {
      "url": "https://go.dev/issue/56694",
      "tags": [
        "Issue Tracking",
        "Vendor Advisory"
      ],
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    },
    {
      "url": "https://groups.google.com/g/golang-announce/c/L_3rmdT0BMU/m/yZDrXjIiBQAJ",
      "tags": [
        "Patch",
        "Release Notes",
        "Third Party Advisory"
      ],
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    },
    {
      "url": "https://pkg.go.dev/vuln/GO-2022-1143",
      "tags": [
        "Patch",
        "Vendor Advisory"
      ],
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    }
  ],
  "vulnStatus": "Modified",
  "weaknesses": [
    {
      "type": "Primary",
      "source": "nvd@nist.gov",
      "description": [
        {
          "lang": "en",
          "value": "CWE-22"
        }
      ]
    }
  ],
  "descriptions": [
    {
      "lang": "en",
      "value": "On Windows, restricted files can be accessed via os.DirFS and http.Dir. The os.DirFS function and http.Dir type provide access to a tree of files rooted at a given directory. These functions permit access to Windows device files under that root. For example, os.DirFS(\"C:/tmp\").Open(\"COM1\") opens the COM1 device. Both os.DirFS and http.Dir only provide read-only filesystem access. In addition, on Windows, an os.DirFS for the directory (the root of the current drive) can permit a maliciously crafted path to escape from the drive and access any path on the system. With fix applied, the behavior of os.DirFS(\"\") has changed. Previously, an empty root was treated equivalently to \"/\", so os.DirFS(\"\").Open(\"tmp\") would open the path \"/tmp\". This now returns an error."
    },
    {
      "lang": "es",
      "value": "En Windows, se puede acceder a archivos restringidos a través de os.DirFS y http.Dir. La función os.DirFS y el tipo http.Dir brindan acceso a un árbol de archivos ubicados en un directorio determinado. Estas funciones permiten el acceso a archivos de dispositivos Windows bajo esa raíz. Por ejemplo, os.DirFS(\"C:/tmp\").Open(\"COM1\") abre el dispositivo COM1. Tanto os.DirFS como http.Dir solo brindan acceso al sistema de archivos de solo lectura. Además, en Windows, un os.DirFS para el directorio (la raíz de la unidad actual) puede permitir que una ruta creada con fines malintencionados escape de la unidad y acceda a cualquier ruta del sistema. Con la corrección aplicada, el comportamiento de os.DirFS(\"\") ha cambiado. Anteriormente, una raíz vacía se trataba de manera equivalente a \"/\", por lo que os.DirFS(\"\").Open(\"tmp\") abriría la ruta \"/tmp\". Esto ahora devuelve un error."
    }
  ],
  "lastModified": "2026-06-17T05:03:42.497",
  "configurations": [
    {
      "nodes": [
        {
          "negate": false,
          "cpeMatch": [
            {
              "criteria": "cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "E0CD51B1-029E-442F-BE6A-772F4754D240",
              "versionEndExcluding": "1.18.9"
            },
            {
              "criteria": "cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "B6AEBFD1-DEE2-40E0-B65C-8C7885014797",
              "versionEndExcluding": "1.19.4",
              "versionStartIncluding": "1.19.0"
            }
          ],
          "operator": "OR"
        },
        {
          "negate": false,
          "cpeMatch": [
            {
              "criteria": "cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:*",
              "vulnerable": false,
              "matchCriteriaId": "A2572D17-1DE6-457B-99CC-64AFD54487EA"
            }
          ],
          "operator": "OR"
        }
      ],
      "operator": "AND"
    }
  ],
  "sourceIdentifier": "security@golang.org"
}