Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-27091 Overview
GeoNode is an open-source geospatial content management system used to publish and manage geospatial data. CVE-2024-27091 is a stored cross-site scripting (XSS) vulnerability [CWE-79] in the platform's rich text editor. An attacker can inject malicious script content that executes when another user views the affected resource. Because <script> elements are not constrained by the browser's CORS policy, the payload can retrieve the victim's CSRF token and submit a request to change the victim's registered email address. That email change enables a full account takeover through password reset. The issue is fixed in GeoNode version 4.2.3.
Critical Impact
A stored XSS payload in GeoNode's rich text editor can steal CSRF tokens and change a victim's email address, enabling complete account takeover.
Affected Products
- GeoNode versions prior to 4.2.3
- Deployments using the built-in rich text editor for resource descriptions and metadata
- GeoNode instances exposing authenticated user content to other users
Discovery Timeline
- 2024-03-27 - CVE-2024-27091 published to NVD with GitHub Security Advisory GHSA-rwcv-whm8-fmxm
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-27091
Vulnerability Analysis
The vulnerability resides in GeoNode's rich text editor, which accepts user-controlled HTML content without adequate sanitization before rendering it in Django templates. When another authenticated user loads a page containing the stored payload, the injected JavaScript executes within that user's browser session.
Although GeoNode sets cookies with secure attributes, same-origin JavaScript can still read the DOM and issue authenticated requests. The attacker's script extracts the victim's CSRF token from the page and submits a POST request to the email change endpoint. Browsers do not apply CORS restrictions to <script> execution against same-origin endpoints, so the forged request succeeds. Once the email is changed, the attacker initiates a password reset and gains full control of the account.
Root Cause
The root cause is missing HTML sanitization on content stored through the rich text editor and later rendered in templates such as metadata_detail.html. GeoNode did not strip or escape dangerous tags and JavaScript event handlers prior to display.
Attack Vector
Exploitation requires network access and user interaction. The attacker creates or edits a GeoNode resource and embeds a malicious HTML/JavaScript payload through the rich text editor. When a privileged user views the resource, the script runs in their session and performs the account-takeover request chain against the user profile endpoint.
# Security patch: geonode/base/templatetags/sanitize_html.py
# Fix for #11862 - Sanitize HTML data (#11958)
from django import template
from django.conf import settings
import nh3
from django.utils.encoding import force_str
register = template.Library()
@register.filter(name="sanitize_html")
def sanitize_html(value):
"""
This filter can be used in Django templates to ensure that HTML content
is safe to render. It leverages the nh3 library to remove dangerous tags
and JavaScript patterns.
Usage in templates: {{ some_variable|sanitize_html|safe }}
"""
# Ensure the value is converted to a string if it's a lazy object
value = force_str(value)
nh3_config = getattr(
settings,
"NH3_DEFAULT_CONFIG",
)
Source: GitHub Commit e53bdeff331f
The fix registers a new sanitize_html template filter backed by the nh3 HTML sanitization library. Templates such as metadata_detail.html were updated with {% load sanitize_html %} so that user-generated HTML passes through the sanitizer before rendering.
Detection Methods for CVE-2024-27091
Indicators of Compromise
- Resource descriptions, abstracts, or metadata fields containing <script>, onerror=, onload=, or inline event handlers submitted through the rich text editor.
- Unexpected POST requests to user profile or email-change endpoints originating from browser sessions shortly after viewing another user's resource.
- Password reset emails sent to addresses that users did not configure themselves.
Detection Strategies
- Audit the GeoNode database for stored resource content containing HTML tags or JavaScript patterns that should have been stripped by sanitization.
- Review web server access logs for sequences in which a user views a resource page and immediately triggers an email change or profile update request.
- Correlate email change events with the preceding page views to identify suspicious automated chains.
Monitoring Recommendations
- Enable detailed Django request logging on account management endpoints (email change, password reset, profile update).
- Monitor for creation or modification of GeoNode resources by newly registered or low-reputation accounts.
- Alert on bulk or rapid email-change operations across distinct user accounts.
How to Mitigate CVE-2024-27091
Immediate Actions Required
- Upgrade GeoNode to version 4.2.3 or later, which introduces the sanitize_html template filter backed by nh3.
- Review and sanitize existing resource content created before the upgrade to remove any stored script payloads.
- Force password resets and verify registered email addresses for accounts that may have been targeted.
Patch Information
The fix is delivered in commit e53bdeff331f4b577918927d60477d4b50cca02f and tracked under GitHub Security Advisory GHSA-rwcv-whm8-fmxm. The patch adds HTML sanitization via the nh3 library and applies the new sanitize_html template filter to templates that render user-supplied HTML, including metadata_detail.html.
Workarounds
- Restrict rich text editor access to trusted users until the upgrade to 4.2.3 is complete.
- Deploy a Content Security Policy (CSP) that disallows inline scripts to reduce the impact of injected payloads.
- Place a web application firewall (WAF) in front of GeoNode with rules that block common XSS payloads in resource metadata fields.
# Verify running GeoNode version and upgrade via pip
pip show GeoNode | grep -i version
# Upgrade to the patched release
pip install --upgrade "GeoNode>=4.2.3"
# Restart the application after upgrade
systemctl restart geonode
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

