<?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 Maxime Escourbiac on Medium]]></title>
        <description><![CDATA[Stories by Maxime Escourbiac on Medium]]></description>
        <link>https://medium.com/@maxime.escourbiac?source=rss-f260bd556dca------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_38gqUeePp4VHuQR</url>
            <title>Stories by Maxime Escourbiac on Medium</title>
            <link>https://medium.com/@maxime.escourbiac?source=rss-f260bd556dca------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 08:39:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@maxime.escourbiac/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[Grafana: CVE-2023–5123 write-up]]></title>
            <link>https://medium.com/@maxime.escourbiac/grafana-cve-2023-5123-write-up-74e1be7ef652?source=rss-f260bd556dca------2</link>
            <guid isPermaLink="false">https://medium.com/p/74e1be7ef652</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[grafana]]></category>
            <dc:creator><![CDATA[Maxime Escourbiac]]></dc:creator>
            <pubDate>Thu, 26 Sep 2024 20:55:21 GMT</pubDate>
            <atom:updated>2024-09-26T21:17:12.502Z</atom:updated>
            <content:encoded><![CDATA[<p>In September 2023, <strong>Michelin CERT (Maxime Escourbiac</strong> and <strong>Yassine Bengana) </strong>conducted a pentest on Grafana application. During this assessment, among several vulnerabilities found, a flaw identified in Grafana’s JSON API Plugin was an interresting reminder of how seemingly minor security oversights can lead to significant security issues.</p><p>At the time of discovery, this type of vulnerability was not yet widely recognized. Since, this topic has been also discussed by <strong>Maxence Schmitt</strong> from <strong>Doyensec</strong> few month after our pentest. His <a href="https://www.doyensec.com/resources/Doyensec_CSPT2CSRF_Whitepaper.pdf">research</a> has significantly contributed to expand the understanding of played a crucial role in highlighting and generalizing client-side path traversal attacks and their potential impact on security, providing valuable insights for further research and mitigation strategies.</p><p><strong>Client-Side Path Traversal in Grafana’s JSON API Plugin: Analyzing the Vulnerability and Its Impact</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n8AGtOUtVJRPQTGZZs-MqQ.png" /></figure><p>In the modern world of data visualization, tools like Grafana become essential for organizations seeking to monitor and visualize real-time metrics. However, even popular open-source platforms like Grafana can be susceptible to security vulnerabilities, especially when interacting with third-party plugins or custom data sources.</p><p>One such vulnerability was recently discovered in Grafana’s `JSON API` plugin (&lt; 1.3.11), a data source plugin used to visualize data from any URL that returns JSON. This report explores the vulnerability, which revolves around <strong>client-side path traversal</strong> attacks, and how, when exploited, can lead to security breaches, including privilege escalation and Cross-Site Request Forgery (CSRF) attacks.</p><p><strong>The Role of the JSON API Plugin in Grafana</strong></p><p>The `JSON API` plugin was a widely used data source plugin that allows users to retrieve and visualize data from any URL that returns JSON, such as REST APIs or static file servers. The plugin’s configuration includes the ability to set a base URL, authorization credentials, custom headers, and other HTTP settings. Once set up, users can integrate the plugin within their Grafana dashboards, providing flexibility for interacting with various external data sources.</p><p>This plugin is now in maintenance mode, no new features will be added. Grafana recommend using the <a href="https://grafana.com/grafana/plugins/yesoreyeram-infinity-datasource">Infinity data source</a> plugin instead</p><p>Data is retrieved from the source using a proxy feature. A request to the data source, like the one generated through the following cURL command, is proxied by Grafana’s server:</p><pre>curl -i -s -k -X $&#39;&lt;method&gt;&#39; -H $&#39;X-Grafana-Org-Id: 1&#39; \ <br>-b $&#39;grafana_session=&lt;session&gt;&#39; - data-binary &#39;&lt;json_body&gt;&#39;\<br>$&#39;https://&lt;server&gt;/api/datasources/proxy/uid/&lt;datasource_uid&gt;/&lt;path&gt;&#39;</pre><p>The plugin’s flexibility allows users to customize the URL, request method, headers, and body, offering powerful data-fetching capabilities. However, this same flexibility is what opened the door to a potentially dangerous vulnerability.</p><p><strong>Vulnerability Breakdown: Client-Side Path Traversal</strong></p><p>The first vulnerability found stems from the lack of encoding in the path parameter of the plugin’s request URL. Path traversal occurs when a user is able to manipulate the URL to access directories or files that should otherwise be restricted. In this case, we discovered that by using the <em>../</em> traversal technique, they were able to traverse up the directory structure and request sensitive endpoints within Grafana’s own API.</p><p>For example, a crafted request could look like this:</p><pre>https://&lt;server&gt;/api/datasources/proxy/uid/&lt;datasource_uid&gt;/../../../../../api/user</pre><p>This manipulation allowed the attackers to bypass the intended data source path and access internal Grafana endpoints, such as the `/api/user` endpoint, which could leak sensitive user information or allow unauthorized access to user-related functionality.</p><p>In addition to the path traversal flaw, a second vulnerability was uncovered related to the validation of HTTP verbs. While the frontend interface only supports `GET` and `POST` methods, the backend failed to properly validate the HTTP method. This meant that an attacker could craft a request using a different HTTP verb, such as `PUT`, which was not intended for use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*d-BI9QIDiaochbDR3F9DCA.png" /><figcaption>Configure the evil dashboard</figcaption></figure><p>For example, by changing the request method to `PUT`, an attacker could alter server-side resources in ways that were never meant to be possible via the Grafana dashboard interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LPnuwxkCfyJU3gtHBGpTRg.png" /><figcaption>Evil dashboard network trace</figcaption></figure><p><strong>Combining the Vulnerabilities: A Path to Full Exploitation</strong></p><p>The real danger arises when both vulnerabilities — path traversal and the improper HTTP verb validation — are combined. This opens up the possibility of performing a <strong>Cross-Site Request Forgery (CSRF)</strong> attack.</p><p>A CSRF attack occurs when a malicious actor tricks a user into unknowingly submit requests on their behalf. In the case of this vulnerability, a crafted dashboard could send requests that the user, when interacting with the dashboard, would execute without their knowledge. For instance, we demonstrated how a crafted request could change the name of the logged-in user, or worse, escalate the user’s privileges by accessing an internal API endpoint, such as:</p><pre>/api/admin/users/&lt;id&gt;/permissions</pre><p>Through this endpoint, an attacker could elevate victim’s privileges to administrator level, granting them full access to the Grafana instance and all of its data.</p><p><strong>Responsible Disclosure</strong></p><p>We would like to express our sincere thanks to Kristian from the Grafana development team for the excellent responsible disclosure process and for promptly providing a patch to address this vulnerability. The collaboration ensured that the issue was addressed swiftly and effectively, helping to maintain the security and integrity of Grafana’s platform.</p><p><em>Timeline</em></p><ul><li>11/09/2023 : Begin of Michelin assessment on Grafana.</li><li>15/09/2023 : End of Michelin assessment on Grafana.</li><li>22/09/2023 : Responsible Disclosure to Grafana Github security page.</li><li>22/09/2023 : Acknowledgement from Grafana Dev Team.</li><li>26/09/2023 : CVE-2023–5123 was asssigned for this vulnerability.</li><li>08/01/2024 : Grafana declared that the vulnerability was fixed weeks ago and public released is ready.</li><li>14/02/2024 : Public release.</li></ul><p><strong>Conclusion</strong></p><p>This vulnerability in Grafana’s `JSON API` plugin serves as a reminder of how seemingly minor security oversights, such as improper path validation or lax HTTP method checks, can lead to significant security issues. Left unchecked, these vulnerabilities could result in full-blown privilege escalation and data breaches, especially when compounded by CSRF vulnerabilities.</p><p>An attacker could, in theory, take full control over a Grafana instance, gaining access to all associated data and compromising the security of an organization’s entire infrastructure. This highlights the importance of a robust and secure design in web applications and plugins, especially those that interact with sensitive data sources.</p><p>The quick patching of this vulnerability by Grafana’s development team, along with the timely disclosure process, serves as a model for how security issues should be handled. The collaboration between Michelin CERT and Grafana underscores the importance of responsible disclosure in safeguarding both individual systems and the broader digital landscape.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74e1be7ef652" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An untypical hacking journey in Google Groups]]></title>
            <link>https://medium.com/@maxime.escourbiac/an-untypical-hacking-journey-in-google-groups-886c557a80a?source=rss-f260bd556dca------2</link>
            <guid isPermaLink="false">https://medium.com/p/886c557a80a</guid>
            <dc:creator><![CDATA[Maxime Escourbiac]]></dc:creator>
            <pubDate>Thu, 01 Sep 2022 18:40:52 GMT</pubDate>
            <atom:updated>2022-09-01T18:40:52.818Z</atom:updated>
            <content:encoded><![CDATA[<p>This article will present the experience I had when I hunted on Google Group. I was not the creator of several technique presented in this blog post, I invite you to read the dedicated articles made on them.</p><p>Firstly, I would thank Maxence SCHMITT (<a href="https://twitter.com/maxenceschmitt">Twitter</a>) who let me to be involved into this journey.</p><p>This story happened between 2018 and 2019 and I considered myself very lucky specially for the last parts where I did not make a huge technical effort to harvest results.</p><p>Sometimes, it just be necessary to be the right person at the good place. However, I hope that scenario could show how even a simple email account takeover could be critical for an entire organization.</p><p><strong>The ignition.</strong></p><p>A first article exposed the fact of thousands of companies using GSuite exposed publicly sensitive information using <strong>**Google Groups**</strong> (https://www.hackread.com/misconfigured-google-groups-settings-leaking-data/). Generally, once a technique is openly published several rounds of responsible disclosure has been already made by the researcher. However, the scope here is very large and it was possible that some dust could be forgotten.</p><p>The first thing was to find a solution to automate findings such as:</p><ul><li>Open groups</li><li>Sensitive keywords found using the search functions</li><li>Look for groups that can be freely joined</li><li>etc…</li></ul><p>A simple python script combined with the Alexa top 1 million website allowed to find companies having google groups not in private mode. Once this step validated, the most difficult part began here…</p><p>In fact, gathering some juicy information was not simple. Several path could be exploited, the first one is obviously the easiest one. Google group came with an integrated search engine, looking for a single character such as `a` revealed which groups authorized every internet user to consult all messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rQsUJPH5rwheO0ihH7A7-A.png" /><figcaption>A Search</figcaption></figure><p>Sometimes, group name is not enough to determine the criticality of the leakage, with some keywords research such as `password` revealed others hidden nuggets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h9NTrcZW2fXq6VmHp9U1rQ.png" /><figcaption>Password Search</figcaption></figure><p>The gold mine became exhausted (I’ve detected that some other researchers looked for this flaw). Most of the companies having bug bounty program were already fixed the configuration of discovered leakage.</p><p><strong>No secrets… Anyways…</strong></p><p>At this point, my automation script raised only empty or not enough critical information to report. When this article reappeared in my Twitter timeline : <a href="https://medium.com/intigriti/how-i-hacked-hundreds-of-companies-through-their-helpdesk-b7680ddc2d4c">How I hacked hundreds of companies through their helpdesk</a></p><p>To summarize this amazing article, Inti De Ceukelaire (@securinti) used what he called the ‘<strong><em>TicketTrick</em></strong>’ to join some communication tool such as Slack, Yammer etc…</p><p>It’s a match!!! The described technique fitted perfectly with Google Groups use cases. After some quick investigation, it appeared that the capability to post messages to groups was defined in a separated configuration attribute. A manual process in addition of the first automation scripts allowed me to grab some extra vulnerabilities to report.</p><p>Maybe, I could have regrets to have reported some P3/P4 data exposure without elevating the criticality with this trick… Whatever…</p><p><strong>Weird behavior… euh WTF?</strong></p><p>When I thought that the golden age of Google Group finding was over trying to verify regressions, I detected an uncommon behavior…</p><p>As I said, in the first part Google group for a domain allows users to search content in groups or messages. By searching some text, the users is redirected to the url :</p><blockquote>https://groups.google.com/a/&lt;domain&gt;/forum/#!search/&lt;search&gt;</blockquote><p>This page displays all the visible messages matching the search request. However, I detected that some visible result cannot be accessible by directly navigating on it. (message or group which own the message).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVMrT4hS-gh4JghHTTA5Nw.png" /><figcaption>Exception when messages tried to be accessed</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yJNaW5a5jBpVtEWjIJ8ZLQ.png" /><figcaption>Exception when group tried to be accessed</figcaption></figure><p>I was not able to explain this new behavior by a group privacy misconfiguration (searchable is not an ACL option). So I thought about kind of code regression this is why I posted a report to Google VRP.</p><p>After the triage, the report was firstly closed with that comment :</p><blockquote>Hi, Thanks for report! It seems like, while it might be surprising, this is actually working as intended and is a feature of the product. The results there include results that are in your private/gsuite gmail account. I believe that the message you’ve highlighted, you’ve been copied in to in another fashion (direct cc,bcc or as part of another group that was included) That said — if you think we misunderstood your report, and you see a well defined security risk, please let us know what we missed.</blockquote><p>I was convinced that was a bug and not a feature, I sent some extra evidence showing the search result was made without being connected to an account having access to the example domain Google Groups, the report was reopened by Google in P2.</p><p>In my side, I tried to collect different contexts where the bug appeared in order to understand the root cause. I found what these groups have in common and it appeared that every groups seems to allow authenticated non-members users to write messages. This parameter seems to index groups messages allowing to be displayed in search features.</p><p>As lot of Google groups has been used by customers to create companies common mailbox such as support@company.com where anonymous users could post message, the amount of vulnerable accounts was quite huge ! According to my script output, I found around <strong>8,000 domains </strong>impacted.</p><p>After a month, the panel has decided to reward this issue ❤</p><p>Once I received the notification of the vulnerability was fixed by Google, I tried to reproduce the bug without success.</p><p><strong>Timeline :</strong></p><ul><li>06/06/2019 : The bug was reported to Google VRP.</li><li>11/06/2019 : Google closed the report.</li><li>11/06/2019 : Extra evidence sent.</li><li>14/06/2019 : Google reopened the report.</li><li>13/07/2019 : Possible RCA sent to Google.</li><li>21/08/2019 : Reward issued.</li><li>05/02/2020 : Google fixed the bug.</li><li>01/09/2022 : Public disclosure</li></ul><p><strong>The blind test.</strong></p><p>Wait the story is not really over… Around 4 months after this episode, I had again a look on Google Group potential misconfigurations.</p><p>I detected that some new feature had a weakness. By typing some word, an attacker can determine the presence of the word/query inside the group.</p><p>If you are searching for “user” or “invoice”, the web app will loop and you will be able to see the number of message matching with the query. And you are looking the a obvious word like “blahblah”, the website will instantly display 0 messages found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nFN3WZnPXa_g3Yhfn5qsjA.png" /><figcaption>Blind search</figcaption></figure><p>Theoretically, an attacker can extract sensitive information by operate like a blind SQL injection methods.</p><p>Google used GWT (Google Web Toolkit) framework to develop the old version of Google Group. For those people who already tested a web application using this framework knows how a nightmare is. By the way, by analyzing the traffic with burp, it appeared that the vulnerable method was “getMatchingMessages” from “/a/&lt;company&gt;/forum/fsearch” endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MosXebrzQYSIwU5MMFVYgg.png" /><figcaption>Traffic analysis</figcaption></figure><p>A second reward was issued for this bug ❤</p><p>This issue was mitigated when the affected version of Groups was deprecated in 2021.</p><p><strong>Timeline :</strong></p><ul><li>20/05/2020 : The bug was reported to Google VRP.</li><li>20/05/2020 : Google triaged the report.</li><li>27/05/2020 : Google accepted the report.</li><li>23/06/2020 : Reward issued.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*4FkCcEQPtTsdd_rrsnL3YQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=886c557a80a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Write-up of Path Traversal on Gravitee.io]]></title>
            <link>https://medium.com/@maxime.escourbiac/write-up-of-path-traversal-on-gravitee-io-8835941be69f?source=rss-f260bd556dca------2</link>
            <guid isPermaLink="false">https://medium.com/p/8835941be69f</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[path-traversal]]></category>
            <dc:creator><![CDATA[Maxime Escourbiac]]></dc:creator>
            <pubDate>Mon, 09 Dec 2019 12:41:01 GMT</pubDate>
            <atom:updated>2019-12-09T12:41:01.707Z</atom:updated>
            <content:encoded><![CDATA[<h3>Write-up for a Path Traversal on Gravitee.io</h3><p>This article will present an uncommon vulnerability discovered by the Michelin CERT team on Gravitee.io.</p><p>The team was able to chain a low-level vulnerability with path traversal to have access to the server file system from an unauthenticated endpoint.</p><p><strong>Gravitee.io</strong></p><p>Gravitee.io is an open source API management solution developed in Java helping organizations to control finely who, when and how users access your APIs. You can visit their website here : <a href="https://github.com/gravitee-io">https://gravitee.io/</a>.</p><p>The source code is available on <a href="https://github.com/gravitee-io">Github</a>. We invite you to contribute to this project.</p><p><strong>SendEmail Service</strong></p><p>The part of the code that will interest us for this article is the email service. This implementation class is the only entry point for sending email from the application.</p><p>Usually email sending feature is commonly vulnerable to Server-Side Template Injection (One of the famous recent example is the RCE in Jira CVE-2019–1158, an excellent article is available <a href="https://medium.com/@ruvlol/rce-in-jira-cve-2019-11581-901b845f0f">here</a> or less critical HTML injection vulnerability (<a href="https://hackerone.com/reports/321029">HackerOne report</a>)</p><p>When an email is written in HTML, images can be included by using HTTP/HTTPS or using CID (or Content-ID) Embedded Images.</p><p>The second option has been used in Gravitee to include resource image such as company logo, etc…</p><p>Let’s see how the CID image has been included in this class.</p><p><strong>Go deeper into the code</strong></p><p>The email service used the following method to add the resource image from an HTML content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2gK6AoWSsHGkA3dz_6PQKA.png" /><figcaption>Add local resource for the mail</figcaption></figure><p>As we can see, the HTML parser <strong>Jsoup</strong> was used to collect all `<strong>&lt;img&gt;</strong>` tags inside the HTML mail and get the value of `<strong>src</strong>` attribute.</p><p>The service will check if the image to be embedded is an url or if it is a local resource, this is done by the second part of the lambda expression checking if the src starts with `<strong>http</strong>` or not.</p><p>Based on it, the service will change the `<strong>href</strong>` attribute to `<strong>cid:xxx</strong>` (link to CID resource).</p><p>The last loop of the method enclosed the binary data of the resource inside the mail with a new instance of `FileSystemResource`. The String `res` was taken as-is from the parsed `&lt;img&gt;` tag.</p><p>The following HTML code passed in this method will enclose the classic `<strong>/etc/passwd</strong>` file.</p><blockquote>&lt;img src=’../../../../../../../etc/passwd’ /&gt;</blockquote><p>By the way, the main point to validate the flaw is where and how we can insert this payload.</p><p><strong>A special thanks to the HTML injection!!</strong></p><p>Before this finding, the team found out that inputs reflected in emails were not protected against `<strong>HTML injection</strong>` vulnerability.</p><p>In order to increase the severity of the vulnerability, we had to find a non-authenticated endpoint that will send emails. The register user feature present on the main page was a good candidate for it. Last Name and First Name parameters were injectable and were reflected in the account validation email sent to the user.</p><p>The following request was used to extract arbitrary file from the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3APwoxyBzEH-Zzs5kg8LpQ.png" /><figcaption>The malicious request</figcaption></figure><p>Now, we just need to wait for the gift mail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*mqDC7ZNylwkXM9yaBvPk7w.png" /><figcaption>This is the gift</figcaption></figure><p>Let’s open the attachment and … Surprise!! `<strong>/etc/passwd</strong>` appeared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*gf-tQBBBKJObnKkYUym3fA.png" /><figcaption>The leaked /etc/passwd</figcaption></figure><p><strong>Responsible Disclosure and fixes.</strong></p><p>This vulnerability (Score CVSSv3 : 8.6) has been discovered during an internal pentest of the Gravitee solution.</p><p>The first step was to contact the Gravitee development team, they had an outstanding reactivity and proposed and deployed a fix less than a week.</p><p>we would like to thank <strong>Gravitee.io</strong> for letting us publish this article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8835941be69f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>