Skip to content
SSRF Disclosed report Beginner

SSRF in rompager-check

The rompager-check script allows an attacker to control the URL passed to cURL, enabling server-side requests to localhost and internal network hosts on ports 80 and 7547. This could let an attacker probe internal services.

bb9866f3f743d6bf69b6836 Follow

Originally disclosed on HackerOne

  • Disclosed after 4 months

Summary

The script rompager.php does not restrict which hosts can be requested. Thereby, an attacker can send HTTP requests to localhost and other servers of the same local network segment, on port 80 and 7547.

Description

In rompager.php, the value of CURLOPT_URL is fully controlled:

PHP
<?php
// [...]
function checkHost($ip, $port) {
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, "http://".$ip);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 1);
	curl_setopt($ch, CURLOPT_HEADER, TRUE);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	curl_setopt($ch, CURLOPT_PORT, $port);
	$data = curl_exec($ch);
// [...]
	} else {
		$ip = $_GET['ip'];
	}
	output("<h4>Port 80</h4>\n");
	checkHost($ip, 80);
	output("<h4>Port 7547</h4>\n");
	checkHost($ip, 7547);

Steps To Reproduce

  1. Access https://rompager.hboeck.de/?ip=localhost;
  2. Notice that No RomPager found is shown under Port 80.

Impact

An attacker could force rompager.hboeck.de to perform HTTP requests to localhost or servers of the same local network segment.

The original report as published on HackerOne, by bb9866f3f743d6bf69b6836. 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

The script does not validate or restrict the user-supplied IP address before using it in a cURL request.

Impact

An attacker could force the server to perform HTTP requests to localhost or servers of the same local network segment.

What the attacker needed

None

How it was found

  1. Access the rompager-check page with the ip parameter set to localhost.
  2. Observe that the page shows 'No RomPager found' under Port 80, indicating a request was made to localhost.

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.

This website lets you check if a device is vulnerable to a specific router bug. The problem is that it takes an address from the user and fetches it without checking, so someone can make the server fetch internal addresses that are not normally reachable from the internet.

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 bb9866f3f743d6bf69b6836

View all

3 more disclosed reports, best first.

More from Hanno's projects

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.