☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Golang logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H 🐛 CWE-20
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2020-29509

CVE-2020-29509 Vulnerability in Golang
📅 PUBLISHED: 2020-12-14 00:00 UTC 🔄 UPDATED: 2026-09-24 11:37 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 2.10%
👁️
2.10% probability
52.5× above the median CVE
Tier: HIGH
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 9.8
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: N Privileges Required None
UI: N User Interaction None
S: U Scope Unchanged
C: H Confidentiality High
I: H Integrity High
A: H Availability High
9.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2020-29509 is a high-severity vulnerability in the encoding/xml package of the Go programming language, affecting all known versions. The flaw stems from incorrect preservation of attribute namespace prefix semantics during tokenization round-trips, enabling crafted XML inputs to be interpreted differently at various processing stages in downstream applications. With a CVSS score of 9.8, this vulnerability poses a critical risk to any Go-based service that parses untrusted XML, potentially enabling authentication bypasses, data integrity violations, or security control evasion. No official patch currently exists, and mitigation relies on third-party validation modules.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Technical Analysis

The vulnerability resides in the encoding/xml package, a standard library component in Go responsible for XML parsing and serialization. The core defect involves how namespace prefixes on attributes are handled during a tokenization round-trip — the process of decoding XML into tokens and then re-encoding or re-processing those tokens.

In correctly functioning XML processors, when an attribute uses a namespace prefix (e.g., xmlns:foo="uri" with an attribute foo:bar="value"), the prefix's meaning must remain consistent through all processing stages. However, in affected Go versions, the encoding/xml package does not preserve these semantics faithfully. When XML input undergoes tokenization and is subsequently processed again — such as when an application validates XML in one pass and then processes it in another — the semantics of namespace prefixes can shift or be lost entirely.

This semantic drift creates a differential behavior window: the same input may be interpreted one way during validation or sanitization and a different way during actual processing. This is a classic parser differential vulnerability, similar in mechanism to request-smuggling or double-decode attacks. An attacker who understands the discrepancy can craft XML payloads that pass security checks yet deliver malicious content when processed downstream.

The attack surface is broad: any Go-based application that accepts XML input from untrusted sources and performs validation, sanitization, transformation, or ingestion is potentially affected. This includes API gateways, authentication services, data ingestion pipelines, and web applications that process XML documents.

Insufficient technical detail is available to identify specific function names or code paths beyond the package-level description. The vulnerability class is best described as a namespace prefix handling flaw causing parser state inconsistency.


Exploitation Scenarios

No public PoC is available; the attack chain is inferred from the vulnerability class.

Step 1 — Reconnaissance/Target Identification: An attacker identifies a Go-based service that accepts XML input. This can be discovered through fingerprinting — Go's HTTP server exposes distinctive Server: header patterns, and common Go frameworks (e.g., Gin, Echo) may expose their own signatures. Attackers may also scan for endpoints that accept Content-Type: application/xml or text/xml requests.

Step 2 — Triggering the Flaw: The attacker crafts an XML document containing attributes with namespace prefixes specifically designed to exploit the round-trip inconsistency. By manipulating prefix declarations and attribute namespaces, the attacker ensures that the first processing pass (e.g., security validation) interprets the document benignly, while a subsequent processing pass interprets it maliciously. The payload is delivered as an HTTP request body to the vulnerable XML-handling endpoint.

Step 3 — Payload/Execution: At the vulnerability-class level, this flaw enables two primary attack vectors: (a) security control bypass — the attacker's XML passes validation checks that rely on the encoding/xml tokenizer, yet contains elements/attributes that trigger unintended behavior in the application's business logic; and (b) data integrity corruption — XML that is expected to be normalized or sanitized retains malicious content due to the inconsistent namespace handling. The exact payload structure depends on the target application's logic and the security controls in place.

Step 4 — Post-Exploitation Impact: Successful exploitation can lead to authentication bypass (if XML is used in credential or token validation), injection of malicious entities into downstream databases, or corruption of XML-based data stores. In applications where XML governs access control decisions, the attacker may gain unauthorized privileges or access to restricted resources.


Impact Assessment

The CVSS score of 9.8 reflects critical severity: the attack vector is network-based with low attack complexity, requires no privileges or user interaction, and the scope is unchanged. The confidentiality, integrity, and availability impacts are all rated high.

Business Impact: For organizations running Go-based XML processing services, this vulnerability undermines trust in any security control that relies on XML parsing. Authentication systems, web services, and data integration pipelines are all at risk. The absence of an official patch means affected systems remain exposed indefinitely.

Affected Systems: All Go applications using encoding/xml with untrusted input are theoretically vulnerable. High-risk deployments include public-facing API endpoints, XML-RPC services, SAML implementations (which are XML-based), and any service performing XML schema validation in Go.

Blast Radius: Given Go's popularity in cloud-native infrastructure — Kubernetes components, Docker tooling, and numerous microservices — the potential blast radius is substantial. The vulnerability enables remote code execution only if combined with further application logic flaws, but authentication bypass and data corruption alone provide sufficient impact for a critical rating.


Detection Guidance

Sigma Rule

title: CVE-2020-29509 - Go XML Namespace Prefix Differential Attack
id: 5c1a2e3d-7b4f-4a9c-8d2e-1f3a5b7c9d1e
status: experimental
description: Detects XML payloads with namespace prefixes designed to exploit Go encoding/xml round-trip inconsistencies
logsource:
  category: webserver
  product: generic
detection:
  selection:
    http.content_type:
      - 'application/xml'
      - 'text/xml'
    http.request_body|contains:
      - 'xmlns:'
      - 'namespace'
  filter_keywords:
    http.request_body|contains:
      - '<?xml'  # normal XML declarations excluded if we want only suspicious ones
  condition: selection and not filter_keywords
fields:
  - src_ip
  - dest_ip
  - http.url
  - http.request_body
falsepositives:
  - Legitimate XML API consumers using namespaces
level: medium
tags:
  - attack.t1190
  - cve.2020-29509
  - go

YARA Rule

rule CVE_2020_29509_Go_XML_Namespace_Exploit
{
    meta:
        author = "Valters IT Security"
        description = "Detects XML payloads exploiting Go encoding/xml namespace prefix round-trip vulnerability"
        cve = "CVE-2020-29509"
        date = "2024-01-15"
        severity = "critical"
    strings:
        $ns_redeclare = /xmlns:\w+="[^"]*"\s+xmlns:\w+="[^"]*"/
        $prefixed_attr = /<\w+[^>]*\s+\w+:\w+=/
        $multiple_ns = /(xmlns:\w+=){2,}/
        $roundtrip = /(?:decode|validate|sanitize|process|parse)[^<]{0,50}(?:xml|document)/
    condition:
        uint16be(0) == 0x3C3F and  // starts with "<?"
        any of ($ns*) or
        ($prefixed_attr and multiple_ns)
}

Suricata IDS Rule

alert http any any -> any any (msg:"CVE-2020-29509 - Go XML Namespace Differential Exploitation Attempt"; flow:established,to_server; content:"Content-Type|3a| application/xml"; nocase; content:"xmlns:"; http_client_body; pcre:"/xmlns:\w+=\x22[^\x22]*\x22[\s\S]{0,2048}xmlns:\w+=/iR"; classtype:attempted-admin; sid:2020950901; rev:1; metadata:created_at 2024_01_15, cve CVE-2020-29509;)

Elastic Detection

sequence by source.ip with maxspan=5m
  [network where event.type == "connection" and destination.port == 443]
  [http where event.category == "network" and http.request.method == "POST"
   and (http.request.content_type == "application/xml" or http.request.content_type == "text/xml")
   and http.request.body.text contains "xmlns:"]
  [network where event.type == "connection" and network.protocol == "tls"]

Splunk SPL Query

index=web sourcetype=iis OR sourcetype=apache
| where like(http_content_type, "%xml%")
| regex http_request_body="(?i)xmlns:\w+=[\x22\x27][^\x22\x27]*[\x22\x27][\s\S]{0,2048}xmlns:\w+="
| table _time, src_ip, dest_ip, uri_path, http_request_body
| eval threat_name="CVE-2020-29509 Go XML Namespace Differential"

Wazuh OSSEC Rule

<group name="go_xml_cve_2020_29509,">
  <rule id="100501" level="12">
    <decoded_as>json</decoded_as>
    <field name="content_type" type="pcre2">(?i)(application|text)/xml</field>
    <field name="request_body" type="pcre2">(?i)xmlns:\w+=["'][^"']*["'][\s\S]{0,2048}xmlns:\w+=</field>
    <description>CVE-2020-29509: Go encoding/xml namespace differential exploitation attempt detected</description>
    <group>attack.t1190,pci_dss_6.5,gdpr_32,</group>
    <mitre>
      <id>T1190</id>
    </mitre>
  </rule>
</group>

Mitigation & Patch Guidance

Patch Confidence: 1/4 (PARTIAL — workaround/mitigation only, no official fix confirmed)

1) Immediate Mitigations:

  • Integrate the github.com/mattermost/xml-roundtrip-validator module to validate all untrusted XML input before it reaches encoding/xml tokenization. This module enforces round-trip consistency and blocks namespace prefix conflicts.
  • Disable or restrict XML parsing on any public-facing endpoint unless absolutely required; use JSON or protocol buffers as alternative data formats.
  • Deploy a Web Application Firewall (WAF) rule to flag and block requests containing suspicious namespace prefix patterns.
  • Monitor XML-handling service logs for anomalies, including validation failures and unexpected processing paths.

2) Patch/Upgrade Steps:

  • No official patch exists as of this report. Monitor the Go issue tracker and security advisories for upstream fixes.
  • When a patched Go version is released, schedule immediate upgrades across all staging and production environments.
  • Prior to upgrading, perform regression testing on XML-handling code paths to verify namespace semantics are preserved correctly.
  • For containerized deployments, rebuild base images with patched Go versions the moment they become available.

3) Long-Term Hardening:

  • Adopt a "deny by default" XML ingestion policy; validate XML structure, namespaces, and schemas before processing.
  • Implement defense-in-depth with multiple independent XML parsers for validation and processing to detect differential behavior.
  • Enforce strict Content-Type validation (reject unexpected XML content types) at the load balancer or API gateway level.
  • Establish a recurring audit process for all Go dependencies and standard library components.
  • Ensure incident response playbooks include this vulnerability's detection signatures and mitigation steps.

References

  1. NVD Entry: https://nvd.nist.gov/vuln/detail/CVE-2020-29509
  2. Go Issue Tracker: https://github.com/golang/go/issues (search for encoding/xml namespace handling)
  3. Mattermost xml-roundtrip-validator: https://github.com/mattermost/xml-roundtrip-validator
  4. Go Security Policy: https://golang.org/security
  5. EPSS Data: https://www.first.org/epss/api (EPSS score 0.02073)

Known Threat Actor Campaigns: No active in-the-wild exploitation campaigns associated with this CVE have been publicly documented. The CVE is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog. Given the patch gap and critical severity, monitoring is recommended as exploit development is a plausible emergent threat.

👁️ SHODAN DORKS (THREAT HUNTING)

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.

Go version:1.15
"encoding/xml" "golang"
goroot lib/pq Go http
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2020-29509/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.