<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Automation on Mazin Ahmed</title><link>https://mazinahmed.net/tags/automation/</link><description>Recent content in Automation on Mazin Ahmed</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 12 Apr 2020 00:00:00 +0000</lastBuildDate><atom:link href="https://mazinahmed.net/tags/automation/index.xml" rel="self" type="application/rss+xml"/><item><title>The Path for Testing Path Traversal Vulnerabilities with Python</title><link>https://mazinahmed.net/blog/testing-for-path-traversal-with-python/</link><pubDate>Sun, 12 Apr 2020 00:00:00 +0000</pubDate><guid>https://mazinahmed.net/blog/testing-for-path-traversal-with-python/</guid><description>&lt;hr&gt;&#10;&lt;p&gt;I have noticed an odd behavior in the &lt;code&gt;requests&lt;/code&gt; module in Python, which uses urllib3. I inspected the root cause via regression testing, and I found that the root cause was a change introduced in urllib3.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; requests&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;requests&lt;span style="color:#f92672"&gt;.&lt;/span&gt;get(&lt;span style="color:#e6db74"&gt;&amp;#34;http://127.0.0.1/../../../../doing/certain/check&amp;#34;&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This should typically send the request to &lt;code&gt;/../../../../doing/certain/check&lt;/code&gt;. Instead, it requests &lt;code&gt;/doing/certain/check&lt;/code&gt; and modifies the specified input.&lt;/p&gt;&#10;&lt;p&gt;The reason is dot-segment normalization, following RFC3986.&lt;/p&gt;&#10;&lt;p&gt;The change to normalize URIs was introduced in this commit[1] to follow RFC3986[2]. The change is based on the &amp;ldquo;Remove Dot Segments&amp;rdquo; section in the RFC.&lt;/p&gt;</description></item></channel></rss>