{"description":"Trending threats, MITRE ATT\u0026CK coverage, and detection metadata. Fed continuously.","favicon":"https://feed.craftedsignal.io/favicon-32x32.png","feed_url":"https://feed.craftedsignal.io/products/http--1.15.0/feed.json","home_page_url":"https://feed.craftedsignal.io/","icon":"https://feed.craftedsignal.io/apple-touch-icon.png","items":[{"_cs_actors":[],"_cs_cpes":[],"_cs_cves":[],"_cs_exploited":false,"_cs_has_poc":false,"_cs_poc_references":[],"_cs_products":["compiler (\u003c= 1.15.0)","openapi3 (\u003c= 1.15.0)","http (\u003c= 1.15.0)","versioning (\u003c= 0.85.0)"],"_cs_severities":["high"],"_cs_tags":["path-traversal","file-write","typespec","supply-chain"],"_cs_type":"advisory","_cs_vendors":["TypeSpec"],"content_html":"\u003cp\u003eThe \u003ccode\u003e@typespec/openapi3\u003c/code\u003e emitter package is vulnerable to a path traversal flaw caused by improper sanitization of user-controlled input. Specifically, the value of a \u003ccode\u003e@versioned\u003c/code\u003e enum member in a TypeSpec (\u003ccode\u003e.tsp\u003c/code\u003e) file is interpolated directly into the output filename template without checking for path traversal characters (\u003ccode\u003e..\u003c/code\u003e) or absolute path indicators. During the emission process, the TypeSpec compiler's \u003ccode\u003eemitFile\u003c/code\u003e function performs no validation to ensure the resolved path remains within the designated \u003ccode\u003eemitterOutputDir\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eAn attacker capable of providing a malicious \u003ccode\u003e.tsp\u003c/code\u003e file to the compiler can force the application to write or overwrite files anywhere on the local filesystem that the compiler process has write access to. While the written content is constrained to valid OpenAPI YAML or JSON structures, the ability to overwrite configuration files or sensitive application data allows for potential denial-of-service or system instability. This vulnerability affects the TypeSpec compiler stack, specifically \u003ccode\u003eopenapi3\u003c/code\u003e and \u003ccode\u003ecompiler\u003c/code\u003e versions \u003ccode\u003e1.15.0\u003c/code\u003e and earlier.\u003c/p\u003e\n\u003ch2 id=\"attack-chain\"\u003eAttack Chain\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eAttacker crafts a malicious TypeSpec source file (\u003ccode\u003e.tsp\u003c/code\u003e) containing a \u003ccode\u003e@versioned\u003c/code\u003e enum member.\u003c/li\u003e\n\u003cli\u003eThe attacker sets a version value containing directory traversal sequences, such as \u003ccode\u003e../../../../tmp/target_file\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe attacker invokes the TypeSpec compiler on the malicious source file.\u003c/li\u003e\n\u003cli\u003eThe \u003ccode\u003eopenapi3\u003c/code\u003e emitter reads the crafted version value during the serialization of the OpenAPI specification.\u003c/li\u003e\n\u003cli\u003eThe compiler performs path interpolation using the malicious version string, constructing a path that points outside the \u003ccode\u003eemitterOutputDir\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe \u003ccode\u003eemitFile\u003c/code\u003e utility executes the file write operation using the resolved traversal path.\u003c/li\u003e\n\u003cli\u003eThe target file on the host filesystem is overwritten with the generated OpenAPI YAML/JSON content.\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2 id=\"impact\"\u003eImpact\u003c/h2\u003e\n\u003cp\u003eSuccessful exploitation allows for arbitrary file creation or overwrite, leading to file corruption and potential denial-of-service scenarios. The impact is limited to the compiler process's filesystem permissions and the file formats supported by the emitter, precluding direct remote code execution or unauthorized file disclosure in the documented exploitation path.\u003c/p\u003e\n\u003ch2 id=\"recommendation\"\u003eRecommendation\u003c/h2\u003e\n\u003cp\u003ePrioritize the implementation of path sanitization within the TypeSpec compiler emission pipeline.\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eImplement logic in the \u003ccode\u003eopenapi3\u003c/code\u003e emitter to resolve the absolute path of the output file after token interpolation and verify it resides within the \u003ccode\u003eemitterOutputDir\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eSlugify or strictly validate all filename tokens derived from spec attributes to strip path separators, absolute path prefixes, and traversal components.\u003c/li\u003e\n\u003cli\u003eAudit and patch \u003ccode\u003epackages/compiler/src/core/emitter-utils.ts\u003c/code\u003e to enforce filesystem containment checks during the \u003ccode\u003ewriteFile\u003c/code\u003e routine.\u003c/li\u003e\n\u003cli\u003eReview all TypeSpec projects for usage of externally supplied or untrusted input in \u003ccode\u003e@versioned\u003c/code\u003e enum definitions.\u003c/li\u003e\n\u003c/ul\u003e\n","date_modified":"2026-09-08T21:49:29Z","date_published":"2026-09-08T21:49:29Z","id":"https://feed.craftedsignal.io/briefs/2026-09-typespec-path-traversal/","summary":"The @typespec/openapi3 emitter fails to sanitize version-derived path tokens, allowing arbitrary file creation or overwrite outside the intended output directory.","title":"Path Traversal in TypeSpec OpenAPI3 Emitter","url":"https://feed.craftedsignal.io/briefs/2026-09-typespec-path-traversal/"}],"language":"en","title":"CraftedSignal Threat Feed - Http (\u003c= 1.15.0)","version":"https://jsonfeed.org/version/1.1"}