{"id":"CVE-2026-43893","aliases":["CVE-2026-43893","GHSA-cw26-7653-2rp5"],"related":[],"kind":"vulnerability","state":"published","title":"exiftool-vendored: Argument injection via newline characters in tag names","summary":"exiftool-vendored provides cross-platform Node.js access to ExifTool. Prior to 35.19.0, exiftool-vendored starts ExifTool in -stay_open True -@ - mode, where arguments are read from stdin one per line. In affected versions, several caller-supplied strings were interpolated into ExifTool arguments without rejecting line delimiters. A newline or carriage return inside one of those strings could split a single intended argument into multiple ExifTool arguments, allowing argument injection. The fix also rejects NUL bytes as unsafe control characters. Applications that pass attacker-controlled strings to affected APIs may allow an attacker to make ExifTool read files accessible to the ExifTool process, or write output to attacker-chosen file system paths accessible to that process. No remote code execution has been demonstrated. This vulnerability is fixed in 35.19.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"exiftool-vendored provides cross-platform Node.js access to ExifTool. Prior to 35.19.0, exiftool-vendored starts ExifTool in -stay_open True -@ - mode, where arguments are read from stdin one per line. In affected versions, several caller-supplied strings were interpolated into ExifTool arguments without rejecting line delimiters. A newline or carriage return inside one of those strings could split a single intended argument into multiple ExifTool arguments, allowing argument injection. The fix also rejects NUL bytes as unsafe control characters. Applications that pass attacker-controlled strings to affected APIs may allow an attacker to make ExifTool read files accessible to the ExifTool process, or write output to attacker-chosen file system paths accessible to that process. No remote code execution has been demonstrated. This vulnerability is fixed in 35.19.0.","source":"cvelist"},{"lang":"en","text":"### Impact\n\n`exiftool-vendored` starts ExifTool in `-stay_open True -@ -` mode, where arguments are read from stdin one per line. In affected versions, several caller-supplied strings were interpolated into ExifTool arguments without rejecting line delimiters. A newline or carriage return inside one of those strings could split a single intended argument into multiple ExifTool arguments, allowing argument injection. The fix also rejects NUL bytes as unsafe control characters.\n\nApplications that pass attacker-controlled strings to affected APIs may allow an attacker to make ExifTool read files accessible to the ExifTool process, or write output to attacker-chosen file system paths accessible to that process. No remote code execution has been demonstrated.\n\nThe reported write-path issue is caused by unsanitized tag **keys**. Tag **values** passed to `ExifTool#write` are not affected, because `WriteTask` already encodes whitespace characters in values (e.g. `\\n` -> `&#10;`) before transmission.\n\nConfirmed affected inputs:\n\n- **Tag-name arguments / tag keys** — keys of the `tags` object passed to `ExifTool#write`; entries of the `retain` option to `ExifTool#deleteAllTags`; entries of the `numericTags` option to `ExifTool#read`; the `tagname` argument to `ExifTool#extractBinaryTag` and `#extractBinaryTagToBuffer`.\n- **Filename / path arguments** to `ExifTool#write`, `#read`, `#readRaw`, `#deleteAllTags`, `#rewriteAllTags`, `#extractBinaryTag`, `#extractBinaryTagToBuffer`, and the binary-extraction convenience methods `#extractJpgFromRaw`, `#extractPreview`, and `#extractThumbnail`. `path.resolve()` does not strip newlines, so an application that accepts attacker-controlled filenames containing newline characters was vulnerable.\n- **The `imageHashType` option** to `ExifTool#read`. TypeScript types restrict this to a literal union, but JS callers or callers with weakened type checking could reach the sink.\n\nApplications that only pass hardcoded strings for tag names, options, and filenames are not affected.\n\n### Patches\n\nFixed in **v35.19.0**. Two layers of defense:\n\n1. **Per-site input validation.** A new `validateTagName` helper rejects any tag-name string containing characters outside the ExifTool tag grammar (letters, digits, `:`, `-`, `_`, and the ExifTool modifiers `*`, `?`, `+`, `#`). Applied at every tag-name interpolation site.\n2. **Defense-in-depth at the command renderer.** `ExifToolTask.renderCommand` now rejects _any_ argument containing `\\r`, `\\n`, or `\\0` before it is sent to the ExifTool process. This catches injection via filename arguments, option values, and any future interpolation site that forgets the per-site validator.\n\n### Workarounds\n\nUpgrade to v35.19.0 or later.\n\nIf upgrading immediately is not possible, reject untrusted strings containing control characters before passing them to the affected APIs. Conservative guard:\n\n```ts\nfunction assertSafeForExifTool(s: string): void {\n  if (typeof s !== \"string\" || /[\\x00-\\x20=<>]/.test(s)) {\n    throw new Error(\"Rejected unsafe string for ExifTool\");\n  }\n}\n```\n\nApply to tag names, `retain` / `numericTags` entries, binary-extraction tag names, filenames, and the `imageHashType` option. This is a denylist and is strictly weaker than the library's internal validator; it is sufficient to block the known PoCs but will accept strings that the library itself now rejects.\n\n### Resources\n\n- ExifTool `-stay_open` / argument-file documentation: https://exiftool.org/exiftool_pod.html#stay_open-FLAG\n- ExifTool tag-name reference: https://exiftool.org/TagNames/\n- CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') — https://cwe.mitre.org/data/definitions/88.html\n\n### Credit\n\n- Reporter: Hank Tam\n- Affiliation: Independent","format":"markdown","source":"ghsa"},{"lang":"es","text":"exiftool-vendored proporciona acceso multiplataforma a ExifTool para Node.js. Antes de la versión 35.19.0, exiftool-vendored inicia ExifTool en modo -stay_open True -@ -, donde los argumentos se leen desde stdin uno por línea. En las versiones afectadas, varias cadenas proporcionadas por el llamador se interpolaron en los argumentos de ExifTool sin rechazar los delimitadores de línea. Un salto de línea o retorno de carro dentro de una de esas cadenas podría dividir un único argumento previsto en múltiples argumentos de ExifTool, permitiendo la inyección de argumentos. La corrección también rechaza los bytes NUL como caracteres de control inseguros. Las aplicaciones que pasan cadenas controladas por el atacante a las API afectadas pueden permitir a un atacante hacer que ExifTool lea archivos accesibles para el proceso de ExifTool, o escribir la salida en rutas del sistema de archivos elegidas por el atacante y accesibles para ese proceso. No se ha demostrado ejecución remota de código. Esta vulnerabilidad se corrige en la versión 35.19.0.","source":"nvd"}],"published":"2026-05-05T19:53:47.000Z","modified":"2026-10-26T18:10:00.173Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","score":8.2,"rating":"HIGH"}],"cwes":["CWE-88"],"affected":[{"ranges":[{"version":"< 35.19.0","status":"affected"}],"vendor":"photostructure","product":"exiftool-vendored.js","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"35.19.0"}],"ecosystem":"npm","package":"exiftool-vendored","purl":"pkg:npm/exiftool-vendored","source":"ghsa"}],"references":[{"url":"https://github.com/photostructure/exiftool-vendored.js/security/advisories/GHSA-cw26-7653-2rp5","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43893","tags":["advisory"],"sources":["ghsa"]},{"url":"https://exiftool.org/TagNames","tags":["web"],"sources":["ghsa"]},{"url":"https://exiftool.org/exiftool_pod.html#stay_open-FLAG","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/photostructure/exiftool-vendored.js","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-05-12T12:54:33.277Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-43893","url":"https://www.cve.org/CVERecord?id=CVE-2026-43893","licence":"CVE Terms of Use","modified":"2026-05-12T12:54:40.823Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cw26-7653-2rp5","url":"https://github.com/advisories/GHSA-cw26-7653-2rp5","licence":"CC-BY-4.0","modified":"2026-05-13T14:34:31.407Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-43893","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43893","licence":"Public domain","modified":"2026-10-26T18:10:00.173Z"}],"updatedAt":"2026-11-25T22:59:21.306Z","epss":{"score":0.00485,"percentile":0.43399,"date":"2026-12-01T12:00:22.000Z"}}