Skip to content
SSRF Disclosed report Intermediate

Server Side Request Forgery (SSRF) in webhook functionality

The webhook feature's anti-SSRF filter did not block IPv6 addresses that map to IPv4, so an attacker could make the server request the cloud metadata endpoint. This could expose sensitive instance metadata.

madara_ Follow

Originally disclosed on HackerOne

Bounty$2,500 Medium 4.9 View original
  • Disclosed after 28 days

Summary:

  • SSRF stands for "Server-Side Request Forgery" in English. It refers to a security vulnerability where an attacker can manipulate a web application to make HTTP requests from the server side instead of the client side. This can allow the attacker to access internal and sensitive resources that are not normally accessible.
  • In an SSRF attack, the attacker can manipulate the requests made by an application to target internal resources such as local files, internal services, or even systems on the internal network. This can lead to the disclosure of sensitive information or unauthorized actions being performed on the server.
  • In this case I was able to bypass the anti ssrf rules in the implemented webhook functionality, I noticed that there is no filter enabled for IPV6 IP addresses with IPv6 address mapped to IPv4.

Description:

Steps To Reproduce

  • To play this account you need to have an organizational account.
  • Additionally, it is necessary to have a public server that interprets php, you can use 000webhost.com
  1. Create a public PHP server and upload the following file h1.php:
<?php
// Obtén los datos de la solicitud
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
header("Content-Type: application/json");
header("Location: http://[::ffff:a9fe:a9fe]"); //IPV6 Compressed
?>
  1. Save the public url where the php script is located
  2. Log in to your hackerone account
  3. Enter your organization's program settings
  4. Look for the webhooks option.
  5. Create a webhook with the previously copied url.
  6. Once the webhook is created, edit it and click on the Test request button
  7. You can see in the webhook logs that in response it launches the header server: EC2ws which corresponds to the Amazon metada instance.

Impact

  • "Server-Side Request Forgery" (SSRF) is a security vulnerability that can have various negative impacts. It occurs when an attacker tricks a server into making requests on their behalf. This can lead to unauthorized access to internal resources, such as databases or internal services, that are typically not accessible from the outside. Additionally, SSRF can be exploited for port scanning, potentially revealing vulnerable services. Attackers may use SSRF to force servers to perform unwanted actions on internal services, leading to data breaches or malicious activities. The vulnerability also poses a risk of bypassing network restrictions, allowing attackers to circumvent security measures. To mitigate SSRF, it is crucial to implement secure development practices, validate and filter user inputs effectively, and ensure that servers do not make unauthorized requests to internal resources. Utilizing whitelists for permitted addresses and disabling unnecessary DNS resolution are recommended measures to enhance security.

The original report as published on HackerOne, by madara_. 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 SSRF protection only filtered IPv4 addresses and did not normalise or block IPv6 addresses that are mapped to IPv4.

Impact

An attacker could make the server reach the cloud metadata instance, which may hold sensitive information.

What the attacker needed

An organisational account; a public PHP server; ability to create and test webhooks

The fix

The SSRF filter should be updated to block IPv6 addresses that map to IPv4, and to use an allowlist of permitted destinations.

How it was found

  1. Create a public PHP server and upload a script that redirects to an IPv6-mapped IPv4 address.
  2. Save the public URL of the PHP script.
  3. Log in to the account and go to the organisation's program settings.
  4. Find the webhooks option and create a webhook using the saved URL.
  5. Edit the webhook and click the Test request button.
  6. Check the webhook logs to see the response from the metadata instance.

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 webhook is a feature where a website sends a request to a URL you provide. Here, the site tried to stop users from pointing webhooks at internal addresses, but it forgot to check a special kind of IPv6 address that actually points to an IPv4 address. That let the server be tricked into contacting a cloud metadata service, which can hold sensitive information.

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 madara_

View all

2 more disclosed reports, best first.

More from HackerOne

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.