{"id":33874,"date":"2026-01-04T05:35:17","date_gmt":"2026-01-04T05:35:17","guid":{"rendered":"http:\/\/localhost\/?p=33874"},"modified":"2026-01-04T05:35:17","modified_gmt":"2026-01-04T05:35:17","slug":"curl-path-traversal-in-curl-file-protocol-handler-allows-unauthorized-file-access","status":"publish","type":"post","link":"https:\/\/zero.redgem.net\/?p=33874","title":{"rendered":"curl: Path Traversal in curl file:\/\/ Protocol Handler Allows Unauthorized File Access_H1:3485930"},"content":{"rendered":"<p>{&#8220;lastseen&#8221;:&#8221;2026-01-04T11:25:49&#8243;,&#8221;description&#8221;:&#8221;## Summary\\nDuring my manual review of the file path handling logic in curl&#8217;s source code, I noticed the absence of proper validation for directory traversal sequences, which I then verified through practical testing. I discovered that curl allows unauthorized access to arbitrary files through the file:\/\/ protocol handler when directory traversal sequences (`..\/`) are used.\\n\\n## Affected version\\ncurl 8.13.0_8 (official Windows build)\\nPlatform: Windows 10\\ncurl version output:\\ncurl 8.13.0 (x86_64-pc-win32) libcurl\/8.13.0 OpenSSL\/3.0.16 (Schannel) zlib\/1.3.1 brotli\/1.1.0 zstd\/1.5.7 libidn2\/2.3.7 libpsl\/0.21.5 (+libidn2\/2.3.7) libssh2\/1.11.1 nghttp2\/1.64.0 ngtcp2\/1.12.0 nghttp3\/1.8.0\\nRelease-Date: 2025-04-02\\nProtocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp ws wss\\nFeatures: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM PSL SPNEGO SSL SSPI TLS-SRP UnixSockets zstd\\n\\n## Vulnerable Code Location\\nThe vulnerability exists in `lib\/file.c` at lines 229-262 where file paths are not properly validated before opening:\\n\\n&#8220;`c\\n\/* Line 229: No validation of \\&#8221;..\/\\&#8221; sequences *\/\\nfd = curlx_open(actual_path, O_RDONLY | CURL_O_BINARY);\\n\\n\/* Similar issues at lines 253, 258, 262 *\/\\nfd = curlx_open(real_path + 1, O_RDONLY);  \/\/ Line 253\\nfd = curlx_open(real_path, O_RDONLY);     \/\/ Line 258\\nfd = curlx_open(real_path, O_RDONLY);     \/\/ Line 262\\n\\nThis code fails to check for directory traversal sequences before opening files. When I reviewed these lines, I noticed there&#8217;s no validation to prevent paths containing `..\/` from accessing files outside the intended directory structure.\\n\\n## Steps To Reproduce\\n1. Download the official curl Windows build from: https:\/\/curl.se\/windows\/dl-8.13.0_8\/curl-8.13.0_8-win64-mingw.zip\\n2. Extract the archive and navigate to the `bin` directory\\n3. Create a test file at `C:\\\\test\\\\poc_test.txt` with content:\\nThis is a test file for Path Traversal vulnerability\\n4. Execute the following command in the same directory as curl.exe:\\n&#8220;`bash\\ncurl \\&#8221;file:\/\/..\/..\/..\/..\/test\/poc_test.txt\\&#8221;\\nDuring my testing, I observed the file contents displayed successfully, proving unauthorized access to files outside the intended directory.\\nSupporting Material\/References\\nScreenshot showing successful file access (Capture.PNG) &#8211; captured during my actual testing on Windows 10\\nProof of Concept script (final_poc.bat) demonstrating the vulnerability step by step\\nTest file used in reproduction (poc_test.txt) with the exact content I tested with\\nReference to similar vulnerability: CVE-2021-22901 (shows this pattern has occurred before)\\n\\n## Impact\\n\\nThis vulnerability allows attackers to read arbitrary files from the system when processing malicious file:\/\/ URLs. The impact includes:\\n\\nSensitive data exposure: System files (hosts, password databases), user documents, and private keys can be accessed. During my testing, I was able to read files from completely different directories, which shows how serious this is.\\nInformation disclosure: System configuration, installed software details, and network settings can be enumerated. This could provide attackers with detailed information about the target system.\\nChained attacks: Can be combined with other vulnerabilities for full system compromise. For example, reading configuration files might reveal credentials for other services.\\nRemote exploitation: Applications that process user-supplied URLs with curl (web scrapers, API clients, download managers) can be exploited remotely. Many developers don&#8217;t realize that file:\/\/ URLs can be dangerous.\\nThe severity is High because:\\n\\nNo authentication required for exploitation &#8211; any attacker can craft a malicious URL\\nAffects confidentiality of sensitive system data &#8211; the core security boundary is violated\\nPresent in the latest official release &#8211; affects all Windows users of the current version\\nSimple to exploit with minimal technical skill &#8211; I was able to reproduce it with just a few simple commands\\nThis isn&#8217;t just a theoretical issue. In my hands-on testing on Windows 10, I successfully accessed files outside the intended directory structure, proving real-world exploitability. The vulnerability is particularly concerning because curl is used in countless applications and systems worldwide.&#8221;,&#8221;published&#8221;:&#8221;2026-01-03T18:59:40&#8243;,&#8221;modified&#8221;:&#8221;2026-01-04T10:34:23&#8243;,&#8221;type&#8221;:&#8221;hackerone&#8221;,&#8221;title&#8221;:&#8221;curl: Path Traversal in curl file:\/\/ Protocol Handler Allows Unauthorized File Access&#8221;,&#8221;source&#8221;:&#8221;&#8221;,&#8221;references&#8221;:&#8221;&#8221;,&#8221;id&#8221;:&#8221;H1:3485930&#8243;,&#8221;bulletinFamily&#8221;:&#8221;bugbounty&#8221;,&#8221;cwe&#8221;:null,&#8221;cvelist&#8221;:[&#8220;CVE-2021-22901&#8243;],&#8221;sourceData&#8221;:&#8221;&#8221;,&#8221;sourceHref&#8221;:&#8221;&#8221;,&#8221;cvss&#8221;:{&#8220;score&#8221;:8.1,&#8221;severity&#8221;:&#8221;HIGH&#8221;,&#8221;vector&#8221;:&#8221;CVSS:3.1\/AV:N\/AC:H\/PR:N\/UI:N\/S:U\/C:H\/I:H\/A:H&#8221;,&#8221;version&#8221;:&#8221;3.1&#8243;},&#8221;cvss2&#8243;:{},&#8221;cvss3&#8243;:{&#8220;version&#8221;:&#8221;&#8221;,&#8221;vectorString&#8221;:&#8221;&#8221;,&#8221;baseScore&#8221;:0,&#8221;baseSeverity&#8221;:&#8221;&#8221;,&#8221;attackVector&#8221;:&#8221;&#8221;,&#8221;attackComplexity&#8221;:&#8221;&#8221;,&#8221;privilegesRequired&#8221;:&#8221;&#8221;,&#8221;userInteraction&#8221;:&#8221;&#8221;,&#8221;scope&#8221;:&#8221;&#8221;,&#8221;confidentialityImpact&#8221;:&#8221;&#8221;,&#8221;integrityImpact&#8221;:&#8221;&#8221;,&#8221;availabilityImpact&#8221;:&#8221;&#8221;,&#8221;cvssV3&#8243;:{&#8220;version&#8221;:&#8221;&#8221;,&#8221;vectorString&#8221;:&#8221;&#8221;,&#8221;baseScore&#8221;:0,&#8221;baseSeverity&#8221;:&#8221;&#8221;,&#8221;attackVector&#8221;:&#8221;&#8221;,&#8221;attackComplexity&#8221;:&#8221;&#8221;,&#8221;privilegesRequired&#8221;:&#8221;&#8221;,&#8221;userInteraction&#8221;:&#8221;&#8221;,&#8221;scope&#8221;:&#8221;&#8221;,&#8221;confidentialityImpact&#8221;:&#8221;&#8221;,&#8221;integrityImpact&#8221;:&#8221;&#8221;,&#8221;availabilityImpact&#8221;:&#8221;&#8221;}},&#8221;href&#8221;:&#8221;https:\/\/hackerone.com\/reports\/3485930&#8243;,&#8221;category_name&#8221;:&#8221;News&#8221;,&#8221;post_link&#8221;:&#8221;&#8221;,&#8221;product&#8221;:&#8221;&#8221;,&#8221;version&#8221;:&#8221;&#8221;,&#8221;vendor&#8221;:&#8221;&#8221;,&#8221;ai_description&#8221;:&#8221;&#8221;,&#8221;ai_severity&#8221;:&#8221;&#8221;,&#8221;ai_vendor&#8221;:&#8221;&#8221;,&#8221;ai_product&#8221;:&#8221;&#8221;,&#8221;ai_version&#8221;:&#8221;&#8221;,&#8221;ai_score&#8221;:0}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>{&#8220;lastseen&#8221;:&#8221;2026-01-04T11:25:49&#8243;,&#8221;description&#8221;:&#8221;## Summary\\nDuring my manual review of the file path handling logic in curl&#8217;s source code, I noticed the absence of proper validation for directory traversal&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[6,8,52,12,117,15,13,7,11,5],"class_list":["post-33874","post","type-post","status-publish","format-standard","hentry","category-category_news","tag-cve","tag-cvss","tag-cvss-81","tag-exploit","tag-hackerone","tag-high","tag-news","tag-security","tag-tapic","tag-vulnerability"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>curl: Path Traversal in curl file:\/\/ Protocol Handler Allows Unauthorized File Access_H1:3485930 - zero redgem<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zero.redgem.net\/?p=33874\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"curl: Path Traversal in curl file:\/\/ Protocol Handler Allows Unauthorized File Access_H1:3485930 - zero redgem\" \/>\n<meta property=\"og:description\" content=\"{&#8220;lastseen&#8221;:&#8221;2026-01-04T11:25:49&#8243;,&#8221;description&#8221;:&#8221;## SummarynDuring my manual review of the file path handling logic in curl&#8217;s source code, I noticed the absence of proper validation for directory traversal...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zero.redgem.net\/?p=33874\" \/>\n<meta property=\"og:site_name\" content=\"zero redgem\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-04T05:35:17+00:00\" \/>\n<meta name=\"author\" content=\"invoker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"invoker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=33874#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=33874\"},\"author\":{\"name\":\"invoker\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\"},\"headline\":\"curl: Path Traversal in curl file:\\\/\\\/ Protocol Handler Allows Unauthorized File Access_H1:3485930\",\"datePublished\":\"2026-01-04T05:35:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=33874\"},\"wordCount\":768,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"keywords\":[\"CVE\",\"CVSS\",\"CVSS-8.1\",\"exploit\",\"hackerone\",\"HIGH\",\"news\",\"Security\",\"tapic\",\"Vulnerability\"],\"articleSection\":[\"category_news\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=33874#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=33874\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?p=33874\",\"name\":\"curl: Path Traversal in curl file:\\\/\\\/ Protocol Handler Allows Unauthorized File Access_H1:3485930 - zero redgem\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\"},\"datePublished\":\"2026-01-04T05:35:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=33874#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=33874\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=33874#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/zero.redgem.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"curl: Path Traversal in curl file:\\\/\\\/ Protocol Handler Allows Unauthorized File Access_H1:3485930\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"name\":\"zero redgem\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/zero.redgem.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\",\"name\":\"zero redgem\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\",\"contentUrl\":\"\",\"width\":191,\"height\":188,\"caption\":\"zero redgem\"},\"image\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\",\"name\":\"invoker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"caption\":\"invoker\"},\"sameAs\":[\"https:\\\/\\\/zero.redgem.net\"],\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"curl: Path Traversal in curl file:\/\/ Protocol Handler Allows Unauthorized File Access_H1:3485930 - zero redgem","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zero.redgem.net\/?p=33874","og_locale":"en_US","og_type":"article","og_title":"curl: Path Traversal in curl file:\/\/ Protocol Handler Allows Unauthorized File Access_H1:3485930 - zero redgem","og_description":"{&#8220;lastseen&#8221;:&#8221;2026-01-04T11:25:49&#8243;,&#8221;description&#8221;:&#8221;## SummarynDuring my manual review of the file path handling logic in curl&#8217;s source code, I noticed the absence of proper validation for directory traversal...","og_url":"https:\/\/zero.redgem.net\/?p=33874","og_site_name":"zero redgem","article_published_time":"2026-01-04T05:35:17+00:00","author":"invoker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"invoker","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/zero.redgem.net\/?p=33874#article","isPartOf":{"@id":"https:\/\/zero.redgem.net\/?p=33874"},"author":{"name":"invoker","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca"},"headline":"curl: Path Traversal in curl file:\/\/ Protocol Handler Allows Unauthorized File Access_H1:3485930","datePublished":"2026-01-04T05:35:17+00:00","mainEntityOfPage":{"@id":"https:\/\/zero.redgem.net\/?p=33874"},"wordCount":768,"commentCount":0,"publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"keywords":["CVE","CVSS","CVSS-8.1","exploit","hackerone","HIGH","news","Security","tapic","Vulnerability"],"articleSection":["category_news"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/zero.redgem.net\/?p=33874#respond"]}]},{"@type":"WebPage","@id":"https:\/\/zero.redgem.net\/?p=33874","url":"https:\/\/zero.redgem.net\/?p=33874","name":"curl: Path Traversal in curl file:\/\/ Protocol Handler Allows Unauthorized File Access_H1:3485930 - zero redgem","isPartOf":{"@id":"https:\/\/zero.redgem.net\/#website"},"datePublished":"2026-01-04T05:35:17+00:00","breadcrumb":{"@id":"https:\/\/zero.redgem.net\/?p=33874#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zero.redgem.net\/?p=33874"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zero.redgem.net\/?p=33874#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zero.redgem.net\/"},{"@type":"ListItem","position":2,"name":"curl: Path Traversal in curl file:\/\/ Protocol Handler Allows Unauthorized File Access_H1:3485930"}]},{"@type":"WebSite","@id":"https:\/\/zero.redgem.net\/#website","url":"https:\/\/zero.redgem.net\/","name":"zero redgem","description":"","publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zero.redgem.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/zero.redgem.net\/#organization","name":"zero redgem","url":"https:\/\/zero.redgem.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/","url":"","contentUrl":"","width":191,"height":188,"caption":"zero redgem"},"image":{"@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca","name":"invoker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","caption":"invoker"},"sameAs":["https:\/\/zero.redgem.net"],"url":"https:\/\/zero.redgem.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/33874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33874"}],"version-history":[{"count":0,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/33874\/revisions"}],"wp:attachment":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}