Show plain JSON{"id": "CVE-2023-40581", "metrics": {"cvssMetricV31": [{"type": "Secondary", "source": "security-advisories@github.com", "cvssData": {"scope": "CHANGED", "version": "3.1", "baseScore": 8.3, "attackVector": "NETWORK", "baseSeverity": "HIGH", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H", "integrityImpact": "HIGH", "userInteraction": "REQUIRED", "attackComplexity": "HIGH", "availabilityImpact": "HIGH", "privilegesRequired": "NONE", "confidentialityImpact": "HIGH"}, "impactScore": 6.0, "exploitabilityScore": 1.6}, {"type": "Primary", "source": "nvd@nist.gov", "cvssData": {"scope": "UNCHANGED", "version": "3.1", "baseScore": 7.8, "attackVector": "LOCAL", "baseSeverity": "HIGH", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", "integrityImpact": "HIGH", "userInteraction": "REQUIRED", "attackComplexity": "LOW", "availabilityImpact": "HIGH", "privilegesRequired": "NONE", "confidentialityImpact": "HIGH"}, "impactScore": 5.9, "exploitabilityScore": 1.8}]}, "published": "2023-09-25T19:15:09.960", "references": [{"url": "https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/tag/2023.09.24.003044", "tags": ["Product", "Release Notes"], "source": "security-advisories@github.com"}, {"url": "https://github.com/yt-dlp/yt-dlp/commit/de015e930747165dbb8fcd360f8775fd973b7d6e", "tags": ["Patch"], "source": "security-advisories@github.com"}, {"url": "https://github.com/yt-dlp/yt-dlp/releases/tag/2021.04.11", "tags": ["Product", "Release Notes"], "source": "security-advisories@github.com"}, {"url": "https://github.com/yt-dlp/yt-dlp/releases/tag/2023.09.24", "tags": ["Product", "Release Notes"], "source": "security-advisories@github.com"}, {"url": "https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-42h4-v29r-42qg", "tags": ["Exploit", "Mitigation", "Patch", "Third Party Advisory"], "source": "security-advisories@github.com"}, {"url": "https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/tag/2023.09.24.003044", "tags": ["Product", "Release Notes"], "source": "af854a3a-2127-422b-91ae-364da2661108"}, {"url": "https://github.com/yt-dlp/yt-dlp/commit/de015e930747165dbb8fcd360f8775fd973b7d6e", "tags": ["Patch"], "source": "af854a3a-2127-422b-91ae-364da2661108"}, {"url": "https://github.com/yt-dlp/yt-dlp/releases/tag/2021.04.11", "tags": ["Product", "Release Notes"], "source": "af854a3a-2127-422b-91ae-364da2661108"}, {"url": "https://github.com/yt-dlp/yt-dlp/releases/tag/2023.09.24", "tags": ["Product", "Release Notes"], "source": "af854a3a-2127-422b-91ae-364da2661108"}, {"url": "https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-42h4-v29r-42qg", "tags": ["Exploit", "Mitigation", "Patch", "Third Party Advisory"], "source": "af854a3a-2127-422b-91ae-364da2661108"}], "vulnStatus": "Modified", "weaknesses": [{"type": "Secondary", "source": "security-advisories@github.com", "description": [{"lang": "en", "value": "CWE-78"}]}], "descriptions": [{"lang": "en", "value": "yt-dlp is a youtube-dl fork with additional features and fixes. yt-dlp allows the user to provide shell command lines to be executed at various stages in its download steps through the `--exec` flag. This flag allows output template expansion in its argument, so that metadata values may be used in the shell commands. The metadata fields can be combined with the `%q` conversion, which is intended to quote/escape these values so they can be safely passed to the shell. However, the escaping used for `cmd` (the shell used by Python's `subprocess` on Windows) does not properly escape special characters, which can allow for remote code execution if `--exec` is used directly with maliciously crafted remote data. This vulnerability only impacts `yt-dlp` on Windows, and the vulnerability is present regardless of whether `yt-dlp` is run from `cmd` or from `PowerShell`. Support for output template expansion in `--exec`, along with this vulnerable behavior, was added to `yt-dlp` in version 2021.04.11. yt-dlp version 2023.09.24 fixes this issue by properly escaping each special character. `\\n` will be replaced by `\\r` as no way of escaping it has been found. It is recommended to upgrade yt-dlp to version 2023.09.24 as soon as possible. Also, always be careful when using --exec, because while this specific vulnerability has been patched, using unvalidated input in shell commands is inherently dangerous. For Windows users who are not able to upgrade: 1. Avoid using any output template expansion in --exec other than {} (filepath). 2. If expansion in --exec is needed, verify the fields you are using do not contain \", | or &. 3. Instead of using --exec, write the info json and load the fields from it instead.\n"}, {"lang": "es", "value": "yt-dlp es un fork de youtube-dl con funciones y correcciones adicionales. yt-dlp permite al usuario proporcionar l\u00edneas de comando de shell para ejecutar en varias etapas de sus pasos de descarga a trav\u00e9s del indicador `--exec`. Este indicador permite la expansi\u00f3n de la plantilla de salida en su argumento, de modo que los valores de metadatos se puedan usar en los comandos del shell. Los campos de metadatos se pueden combinar con la conversi\u00f3n `%q`, cuyo objetivo es citar/escapar estos valores para que puedan pasarse de forma segura al shell. Sin embargo, el escape usado para `cmd` (el shell usado por el `subproceso` de Python en Windows) no escapa adecuadamente a los caracteres especiales, lo que puede permitir la ejecuci\u00f3n remota de c\u00f3digo si `--exec` se usa directamente con datos remotos creados con fines maliciosos. Esta vulnerabilidad solo afecta a \"yt-dlp\" en Windows y est\u00e1 presente independientemente de si \"yt-dlp\" se ejecuta desde \"cmd\" o desde \"PowerShell\". La compatibilidad con la expansi\u00f3n de la plantilla de salida en `--exec`, junto con este comportamiento vulnerable, se agreg\u00f3 a `yt-dlp` en la versi\u00f3n 2021.04.11. La versi\u00f3n 2023.09.24 de yt-dlp soluciona este problema escapando correctamente cada car\u00e1cter especial. `\\n` ser\u00e1 reemplazado por `\\r` ya que no se ha encontrado ninguna forma de escapar. Se recomienda actualizar yt-dlp a la versi\u00f3n 2023.09.24 lo antes posible. Adem\u00e1s, siempre tenga cuidado al usar --exec, porque si bien esta vulnerabilidad espec\u00edfica ha sido parcheada, usar entradas no validadas en los comandos del shell es inherentemente peligroso. Para usuarios de Windows que no pueden actualizar: 1. Evite utilizar cualquier expansi\u00f3n de plantilla de salida en --exec que no sea {} (ruta de archivo). 2. Si se necesita expansi\u00f3n en --exec, verifique que los campos que est\u00e1 usando no contengan \", | o &. 3. En lugar de usar --exec, escriba la informaci\u00f3n json y cargue los campos desde all\u00ed."}], "lastModified": "2024-11-21T08:19:45.480", "configurations": [{"nodes": [{"negate": false, "cpeMatch": [{"criteria": "cpe:2.3:a:yt-dlp_project:yt-dlp:*:*:*:*:*:*:*:*", "vulnerable": true, "matchCriteriaId": "AAE6AF84-62B8-469A-9F5D-FC638DCFE350", "versionEndExcluding": "2023.09.24", "versionStartIncluding": "2021.04.11"}], "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-advisories@github.com"}