Skip to content
SSRF Disclosed report Intermediate

Server-Side Request Forgery (SSRF) via Game Export API

The game export API passed a user-supplied 'players' query parameter straight to an HTTP client without validation, so the server would fetch any URL given. An attacker could make the server request internal or cloud metadata addresses, potentially exposing credentials and internal services.

oblivionsage Follow

Originally disclosed on HackerOne

Critical 9.8 View original
  • Fixed in 5 days
  • Disclosed after 6 days

Summary

Hello Lichess Team,

I found a Server-Side Request Forgery vulnerability in the game export functionality. An attacker can make the Lichess server send HTTP requests to arbitrary URLs by manipulating the players parameter. This works on public endpoints that don't require any authentication

Description:

The issue is in the game export API endpoints that accept a players parameter. When I looked at the code, I noticed that this parameter gets passed directly to RealPlayerApi.apply() without any URL validation

Here's the problematic flow I found:

In app/controllers/Game.scala:

Bash
val config = GameApiV2.OneConfig(
  format = GameApiV2.Format.byRequest,
  imported = getBool("imported"),
  flags = requestPgnFlags(extended = true),
  playerFile = get("players")  // User input taken directly
)

Then in modules/api/src/main/GameApiV2.scala:

Bash
realPlayers                  <- config.playerFile.so(realPlayerApi.apply)

And finally in modules/web/src/main/RealPlayer.scala

Bash
def apply(url: String): Fu[Option[RealPlayers]] = cache.get(url)
// This leads to:
ws.url(url).withRequestTimeout(3.seconds).get()

The get("players") method directly reads from HTTP query parameters without any validation. The so() method executes the function when the Option contains a value, so any URL I provide gets passed straight to the HTTP client

PoC

Note: I discovered this vulnerability through source code analysis and then confirmed it by testing live on the official Lichess website. The following PoC demonstrates the issue as it exists in the production environment

  1. Pick any valid game ID from Lichess (like from a recent game)
image.png
image.png From the original on HackerOne
  1. Make a request to: /game/export/[GAME_ID]?players=http://169.254.169.254/latest/meta-data/

  2. The server will make an HTTP request to the provided URL

  3. You can also test with: /api/games/export/_ids?players=[URL] or /api/games/user/[USERNAME]?players=[URL]

  4. Monitor your server logs or use a service like webhook.site to confirm the request

image.png
image.png From the original on HackerOne
image.png
image.png

Mitigation:

To fix this, you should:

  • Add URL validation to only allow specific trusted domains for the players parameter

  • Implement a whitelist of allowed URLs or URL patterns

  • Consider removing the feature entirely if it's not critical

  • Add authentication requirements for these endpoints

  • Block requests to private IP ranges (127.x.x.x, 192.168.x.x, 10.x.x.x, 169.254.x.x) (For security and ethical reasons, I did not send any actual requests to these IP addresses. If required, I can provide my own IP address or any additional information for verification purposes)

The fix should be in RealPlayerApi.apply() method to validate the URL before making any HTTP requests.

https://cwe.mitre.org/data/definitions/918.html

Impact

An attacker could use this to:

  • Access cloud metadata services (AWS, GCP) to steal credentials and configuration
  • Scan internal networks and discover internal services
  • Access internal APIs and admin panels that aren't exposed to the internet
  • Potentially read sensitive internal data or configuration files
  • Perform port scanning of internal infrastructure

This is particularly concerning because the endpoints are public - no authentication needed. Also, since it's on a high-traffic site like Lichess, an attacker could potentially use this to bypass IP-based restrictions on internal services

The original report as published on HackerOne, by oblivionsage. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

How it worked

Root cause

Likely the 'players' query parameter was passed directly into the HTTP client with no allowlist or private-address blocking.

Impact

An attacker could reach cloud metadata services and internal networks, potentially stealing credentials or reading internal data, and the endpoints needed no authentication; the author states they did not actually send requests to private addresses.

What the attacker needed

No authentication; a valid game ID or username

The fix

The URL should be validated in RealPlayerApi.apply(), for example with an allowlist of trusted domains and blocking of private IP ranges.

How it was found

  1. Pick a valid game ID from the site.
  2. Send a request to the game export endpoint with the players parameter set to a chosen URL.
  3. The server makes an HTTP request to that URL.
  4. Confirm the outbound request using your own server logs or a request-capture service.

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 report has not been written yet. The Original tab links to the source.

A server-side request forgery (SSRF) bug means the server can be tricked into fetching a web address chosen by the attacker. Here the export feature accepted a link in a URL parameter and fetched it without checking where it pointed, so someone could aim it at internal machines or cloud metadata pages that outsiders cannot normally reach.

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 oblivionsage

View all

6 more disclosed reports, best first.

More from Lichess

View all

The newest disclosed reports for this program.

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.