CVE-2025-27088
JSON

8.4high

Reflected Cross-site Scripting (XSS) in template implementation in oxyno-zeta/s3-proxy

Severity
8.4high CVSS:4.0 by GitHub_M
Exploit likelihood
0.50% (higher than 44% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-pp9m-qf39-hxjcGO-2025-3477

Description

oxyno-zeta/s3-proxy is an aws s3 proxy written in go. In affected versions a Reflected Cross-site Scripting (XSS) vulnerability enables attackers to create malicious URLs that, when visited, inject scripts into the web application. This can lead to session hijacking or phishing attacks on a trusted domain, posing a moderate risk to all users. It's possible to inject html elements, including scripts through the folder-list template. The affected template allows users to interact with the URL path provided by the `Request.URL.Path` variable, which is then rendered directly into the HTML without proper sanitization or escaping. This can be abused by attackers who craft a malicious URL containing injected HTML or JavaScript. When users visit such a URL, the malicious script will be executed in the user's context. This issue has been addressed in version 4.18.1 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

Affected

Product or packageVersionsReported by
oxyno-zeta s3-proxy< 4.18.0, before 2.23.1, before 4.18.1CVE List, NVD
github.com/oxyno-zeta/s3-proxy/cmd/s3-proxy (Go)before 0.0.0-20250220214310-c611c741ed48GitHub Advisory Database
github.com/oxyno-zeta/s3-proxy (Go)before 0.0.0-20250220214310-c611c741ed48Go Vulnerability Database

All scores

GitHub_M8.4high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:H/SI:H/SA:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:H/SI:H/SA:N
NVD8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N

Classification

CWE-79

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

oxyno-zeta/s3-proxy is an aws s3 proxy written in go. In affected versions a Reflected Cross-site Scripting (XSS) vulnerability enables attackers to create malicious URLs that, when visited, inject scripts into the web application. This can lead to session hijacking or phishing attacks on a trusted domain, posing a moderate risk to all users. It's possible to inject html elements, including scripts through the folder-list template. The affected template allows users to interact with the URL path provided by the `Request.URL.Path` variable, which is then rendered directly into the HTML without proper sanitization or escaping. This can be abused by attackers who craft a malicious URL containing injected HTML or JavaScript. When users visit such a URL, the malicious script will be executed in the user's context. This issue has been addressed in version 4.18.1 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

GitHub Advisory Database
Summary

A Reflected Cross-site Scripting (XSS) vulnerability enables attackers to create malicious URLs that, when visited, inject scripts into the web application. This can lead to session hijacking or phishing attacks on a trusted domain, posing a high risk to all users.

Details

Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer. It's possible to inject html elements, including scripts through the folder-list template. It seems like the .Request.URL.Path variable is not escaped.

I did some research and found it might be due to the text/template import being used in the template implementation, instead of the safer html/template.

PoC

Complete instructions, including specific configuration details, to reproduce the vulnerability. Using the default template configuration, the vulnerability can be reproduced with the following steps.

  1. Navigate to https://your-s3-proxy.com/path-not-found and confirm the page looks as follows: image

  2. Try inserting an HTML element by changing /path-not-found to /<img src="x"> and confirm the page looks as follows: image

  3. Now it should be possible to run any JavaScript by manipulating the onerror property of the img element. This should make the link look like https://your-s3-proxy.com/<img src="x" onerror="alert(1)">. Confirm that going to this URL will in fact shows an alert in the browser.

Impact

The affected template allows users to interact with the URL path provided by the Request.URL.Path variable, which is then rendered directly into the HTML without proper sanitization or escaping. This can be abused by attackers who craft a malicious URL containing injected HTML or JavaScript. When users visit such a URL, the malicious script will be executed in the user's context, leading to potential risks such as:

  • Session Hijacking: Malicious scripts could be used to steal session cookies or other sensitive information.
  • Phishing Attacks: JavaScript could be injected to trick users into submitting sensitive information, such as login credentials.

This vulnerability can be exploited by attackers who craft URLs containing malicious payloads, which would then execute in the user's browser when they access the affected page. This poses a high risk to all users who visit such URLs.

Go Vulnerability Database

S3-Proxy allows Reflected Cross-site Scripting (XSS) in template implementation in github.com/oxyno-zeta/s3-proxy

NVD (es)

oxyno-zeta/s3-proxy es un proxy de AWS S3 escrito en Go. En las versiones afectadas, una vulnerabilidad de Cross-site Scripting (XSS) reflejado permite a los atacantes crear URL maliciosas que, cuando se visitan, inyectan secuencias de comandos en la aplicación web. Esto puede provocar secuestros de sesión o ataques de phishing en un dominio de confianza, lo que supone un riesgo moderado para todos los usuarios. Es posible inyectar elementos HTML, incluidas secuencias de comandos, a través de la plantilla de lista de carpetas. La plantilla afectada permite a los usuarios interactuar con la ruta de URL proporcionada por la variable `Request.URL.Path`, que luego se representa directamente en el HTML sin la depuración o el escape adecuados. Los atacantes pueden abusar de esto y manipular una URL maliciosa que contenga HTML o JavaScript inyectado. Cuando los usuarios visitan una URL de este tipo, la secuencia de comandos maliciosa se ejecutará en el contexto del usuario. Este problema se ha solucionado en la versión 4.18.1 y se recomienda a todos los usuarios que actualicen. No existen workarounds para esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-27088 changed 2025-02-21CVE Terms of Use
GitHub Advisory DatabaseGHSA-pp9m-qf39-hxjc changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2025-3477 changed 2026-03-03CC-BY-4.0
NVDCVE-2025-27088 changed 2026-06-17Public domain