Skip to content
SSRF Write-up Advanced

Dangerous Import: SourceForge Patches Critical Code Vulnerability

An arbitrary file read vulnerability in Apache Allura's discussion import feature allowed attackers to read local files by supplying a file:// URL in an attachment. This could be used to obtain the session signing key and then achieve remote code execution by crafting a malicious serialized session cookie.

Stefan Schiller Follow

Published on sonarsource.com

SourceForge is a popular software platform that offers repositories for developers to manage their projects, collaborate with others, and distribute software to a wide audience. Although its popularity as a developer platform has decreased over the past few years, it is still actively used, with more than 2.6 million…

Stefan Schiller (@scryh_), on sonarsource.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

The import feature passed a user-controlled URL to a function that supports the file:// scheme without validating the scheme or destination, and session cookies were deserialized with pickle.

Impact

Exploitation could have allowed full compromise of SourceForge, potentially poisoning deployed files for nearly 20 million users, though there were no signs of in-the-wild exploitation.

What the attacker needed

A free account; ability to create a project; Discussion tool enabled

How it was found

  1. Create an account and a project with the Discussion tool enabled.
  2. Craft a JSON import file with an attachment whose url attribute points to a local file.
  3. Import the discussion to read the local file and attach its contents to a post.
  4. Read the configuration file to obtain the session validation key.
  5. Craft a malicious serialized session cookie signed with that key.
  6. Send the cookie to the server to execute arbitrary commands.

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.

The software let users import discussion posts from a file, and it fetched attachments from whatever address was given, including local files on the server. By reading a configuration file, an attacker could get the secret key used to sign login cookies, then create a fake cookie that runs commands on the server.

What is SSRF?

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

More by Stefan Schiller

View all

10 more disclosed reports, best first.

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.