Skip to content
SSRF Write-up Intermediate

First attempts

A misconfiguration in JetBrains YouTrack's Workflows feature allowed a user to bypass the built-in HTTP client wrapper and directly instantiate Apache HTTP client classes, enabling server-side request forgery (SSRF) to internal services such as the AWS metadata endpoint. An attacker could read sensitive instance metadata.

mitmlab.com

Published on mitmlab.com

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.

Yurii Sanin, on mitmlab.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the ClassShutter whitelist for the JavaScript sandbox included Apache HTTP client classes (CloseableHttpClient, HttpGet) that allowed direct HTTP requests, bypassing the address-filtering wrapper.

Impact

An attacker could perform SSRF to access the AWS metadata service and potentially retrieve sensitive instance credentials.

What the attacker needed

Access to create or modify workflows; ability to trigger the workflow

The fix

The YouTrack team fixed it by removing the org.apache.http.impl.client package from the ClassShutter whitelist.

How it was found

  1. Create a workflow script that uses the provided HTTP wrapper to send a request to the AWS metadata service.
  2. Observe that the request fails due to address filtering.
  3. Modify the script to directly instantiate Apache HTTP client classes from the whitelisted org.apache.http namespace.
  4. Send a request to the AWS metadata service using the direct HTTP client and receive a 200 response.
  5. Use the sandbox Utils.readString method to read the response content and add it as a comment.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Server-Side Request Forgery (SSRF) is when an attacker tricks a server into making requests to internal systems that the attacker cannot reach directly. In this case, a scripting feature in YouTrack let users run code, and the code could bypass restrictions to access the cloud server's internal metadata service, which holds sensitive information like access keys.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.