☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Golang logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 9.8 🐛 CWE-115
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2020-29511

CVE-2020-29511 Vulnerability in Golang
📅 PUBLISHED: 2020-12-14 00:00 UTC 🔄 UPDATED: 2026-10-14 23:32 UTC
[ ZERO-DAY / UNPATCHED ] [ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 1.97%
👁️
1.97% probability
49.1× 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: UNKNOWN / CHECK VENDOR
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
9.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2020-29511 is a critical severity (CVSS 9.8) vulnerability in the Go programming language's standard encoding/xml package, affecting all versions of Go. The flaw stems from incorrect preservation of XML element namespace prefixes during tokenization round-trips, enabling an attacker to craft XML inputs that behave inconsistently across different processing stages in downstream applications. This discrepancy can result in differential parsing outcomes, potentially leading to authentication bypass, security control evasion, or injection of malicious content into applications that rely on Go's XML parser for security-relevant validation. Given the ubiquity of Go in web services, API gateways, and cloud infrastructure, the affected population is substantial despite the lack of confirmed in-the-wild exploitation (EPSS 0.01942, 78.2nd percentile).

⚡ 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 all versions of Go. The package implements an XML tokenizer that converts raw XML data into a stream of tokens (start elements, end elements, character data, etc.) that applications consume for processing. The flaw specifically concerns how namespace prefixes are handled when XML tokens are serialized back (round-tripped) into a reconstructed byte stream.

In the XML Namespaces specification (W3C Recommendation), element names consist of a local part and an optional namespace prefix (e.g., <foo:bar> where foo is the prefix and bar is the local name). The semantic meaning of the document is determined by the namespace URI to which a prefix maps, resolved via xmlns declarations. The Go encoding/xml tokenizer, when encountering elements with namespace prefixes, must preserve the prefixed form so that downstream consumers can correctly resolve the namespace context.

The vulnerability occurs because the tokenizer does not consistently maintain the original prefix semantics. When the tokenizer decodes an XML token containing a namespace prefix, and that token is subsequently re-encoded (round-tripped) through the Marshal or related reconstruction paths, the output may lose or alter the prefix information. This can produce a representation that is lexically different but semantically intended to be equivalent — or vice versa — causing two different parsing stages in a downstream application to interpret the same input differently.

Specifically, an attacker can craft an XML document where a namespace prefix is used in an ambiguous or non-standard manner. For example, an element might declare a namespace prefix in a scope that is not captured correctly during tokenization. When the tokenized form is processed (e.g., for signature validation, schema checking, or access-control decisions), it yields one interpretation; when the raw bytes are processed by a different component, the namespace resolution changes, yielding a conflicting interpretation.

This class of flaw is known as a "namespace confusion" or "XML round-trip inconsistency" vulnerability. The github.com/mattermost/xml-roundtrip-validator module referenced in the workaround confirms that the issue was discovered and publicized in the context of Mattermost's security research. The module validates that round-tripping XML through Go's parser preserves namespace semantics, highlighting that the problem is recognized and actively mitigated by third parties.

Attack Surface: Any Go application that: (1) receives untrusted XML from external sources, (2) parses it using encoding/xml, and (3) uses the parsed output for security-relevant decisions (authentication, authorization, data validation, cryptographic signature verification). Common targets include XML-based web services, SOAP endpoints, SAML assertion processors, configuration file parsers, and API request handlers.

Attack Mechanism Class: Differential parsing / semantic desynchronization — the same input yields different interpretations depending on the processing pipeline stage, enabling bypass of validation logic.


Exploitation Scenarios

Note: No public PoC is confirmed available in the OSV/NVD data (POC_STATUS: UNKNOWN). The attack chain below is inferred from the vulnerability class based strictly on the NVD description.

Scenario: SAML/XML Signature Validation Bypass in Authentication Gateway

Step 1 — Reconnaissance/Target Identification: An attacker identifies a Go-based service that processes XML, particularly SAML assertions for SSO, SOAP-based APIs, or XML configuration import endpoints. The attacker fingerprints the application as Go (via HTTP header Server: Go, error pages, or behavioral analysis) to confirm the likely use of encoding/xml.

Step 2 — Triggering the Flaw: The attacker crafts an XML document containing an element with a namespace prefix that the Go tokenizer fails to preserve correctly during round-trip processing. For example, the attacker constructs an element where the prefix is declared and used in a manner that creates a discrepancy: the signature-validation component (which parses the token stream) sees one namespace URI binding, while the authentication-decision component (which uses the round-tripped bytes) resolves a different namespace URI. The attacker structures the document so that a security-critical element (e.g., <Subject> or <Role>) is interpreted as belonging to a privileged namespace by one parser but not by another.

Step 3 — Payload/Execution: The malicious XML is submitted to the target service as a signed SAML assertion or XML API request. The attacker ensures the document's original byte-level signature checks out against a valid signature (if required), exploiting the fact that the signature verification stage and the downstream content-consumption stage disagree on the semantic content due to the namespace prefix desynchronization. The payload does not require remote code execution — the goal is to manipulate the logical content that a downstream consumer acts upon. If no signature is required, the attacker directly embeds privileged assertion values within the namespace-confused element.

Step 4 — Post-Exploitation: If successful, the attacker achieves: (a) Authentication bypass — impersonating a privileged user/role by having the application interpret the assertion as belonging to an admin or elevated-privilege group, or (b) Authorization bypass — passing XML through a validation filter that appears benign but is interpreted with forged authority downstream. The attacker gains unauthorized access to protected resources, can perform administrative actions, or exfiltrate data. The CVSS base score of 9.8 reflects criticality: this vulnerability, if exploitable, enables full compromise of application security without requiring authentication or user interaction.


Impact Assessment

CVSS: 9.8 (Critical) — While the full vector is not disclosed in the available data, the score indicates: near-total confidentiality impact, near-total integrity impact, and near-total availability impact, combined with network-based exploitability and no required privileges or user interaction. This strongly suggests the vulnerability can be exploited remotely by an unauthenticated attacker.

Affected Systems: All Go applications (any version) that use encoding/xml to parse untrusted XML and rely on namespace semantics for security decisions. High-risk deployment contexts include:

  • Web services and API gateways handling SOAP or XML-RPC requests.
  • Identity providers and SSO systems processing SAML assertions.
  • Applications with XML signature verification (XML DSig, SAML, WS-Security).
  • Configuration parsing engines ingesting XML configuration files from untrusted sources.

Business Impact:

  • Confidentiality: Unauthorized access to sensitive data, user accounts, and internal systems.
  • Integrity: Tampering with authentication/authorization logic, injecting forged privilege claims.
  • Availability: Depending on the application logic, a namespace confusion could cause parsing errors leading to denial of service.

Blast Radius: The flaw is in a standard library, meaning every Go binary built with encoding/xml code incorporated can inherit the flaw. However, exploitability requires the specific downstream processing pattern described. The lack of CISA KEV listing (KEV: NO) and absence of public PoC/exploit code (PoC: UNKNOWN, Exploit Code: NO) reduces the immediate exploitation likelihood, but the high EPSS percentile (78.2%) indicates active scanning/investigation of this CVE in the threat landscape.


Detection Guidance

Sigma Rule

title: Go encoding/xml Namespace Prefix Round-trip Exploitation Attempt
id: 8c47f2d1-3b9a-4c5e-9d11-2e6f5a8b1c22
status: experimental
description: Detects HTTP/XML requests containing unusual namespace prefix patterns potentially targeting CVE-2020-29511 in Go-based services.
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2020-29511
author: valtersit.com Threat Intel
date: 2025/01/01
logsource:
    category: webserver
    product: generic
detection:
    selection:
        # Look for XML payloads with namespace prefixes used inconsistently or redefined within the same document
        c-uri|contains:
            - '<?xml'
        c-uri|re: '(<[a-zA-Z_][a-zA-Z0-9_.-]*:)'  # element with prefix
    filter:
        - c-uri|contains: '/wsdl'  # common legitimate WSDL endpoints
    condition: selection and not filter
level: high
falsepositives:
    - Legitimate XML services using standard namespace prefixes (e.g., SOAP, SAML)
    - Applications that intentionally generate prefixed XML

YARA Rule

rule Go_encoding_xml_Namespace_Roundtrip_Malware
{
    meta:
        author = "valtersit.com Threat Intel"
        description = "Detects XML payloads with namespace prefix abuse patterns targeting CVE-2020-29511"
        reference = "https://nvd.nist.gov/vuln/detail/CVE-2020-29511"
        date = "2025-01-01"
    strings:
        // Pattern matching an element with a namespace prefix followed by unexpected re-declaration
        $ns_element = /<[a-zA-Z_][a-zA-Z0-9_-]*:/
        $xmlns_redecl = /xmlns:[a-zA-Z_][a-zA-Z0-9_-]*\s*=\s*["'][^"']*["'][^>]*>/
        $sig_present = /<ds:Signature|<Signature/i
    condition:
        uint32be(0) == 0x3C3F786D or uint32le(0) == 0x3C3F786D // starts with "<?xm"
        and #ns_element > 5
        and $xmlns_redecl
        and $sig_present
}

Suricata IDS Rule

alert http any any -> any any (msg:"CVE-2020-29511 - Go encoding/xml Namespace Prefix Round-trip Exploitation Attempt"; flow:established,to_server; content:"<?xml"; nocase; http.client_body; pcre:"/<[a-zA-Z_][a-zA-Z0-9]*:/i"; pcre:"/xmlns:[a-zA-Z_][a-zA-Z0-9]*\s*=\s*[\x22\x27][^\x22\x27]*[\x22\x27][^>]*>/i"; reference:cve,2020-29511; classtype:attempted-admin; sid:10029511; rev:1;)

Elastic Detection

network where process.name == "httpd" or process.name == "nginx" or true
  and event.action in ("connection_established", "post_request")
  and transaction.id != null
  and http.request.body.text like "<?xml*"
  and http.request.body.text regex~ /<[a-zA-Z_][a-zA-Z0-9_.-]*:/
  and http.request.body.text regex~ /xmlns:[a-zA-Z_][a-zA-Z0-9]*\s*=\s*["'][^"']*["'][^>]*>/
  and not http.request.body.text like "*?>*/wsdl" // exclude legitimate WSDL
  with timeout 5s

Splunk SPL Query

index=web sourcetype=access_combined OR sourcetype=apache_access
| spath input=uri
| regex _raw="<\?xml"
| regex _raw="<[a-zA-Z_][a-zA-Z0-9_-]*:.*xmlns:[a-zA-Z_][a-zA-Z0-9_-]*=\"/"
| where NOT _raw LIKE "*wsdl*"
| stats count by clientip, uri, status
| sort -count

Wazuh OSSEC Rule

<group name="go_xml_cve_2020_29511,">
  <rule id="100295" level="12">
    <decoded_as>json</decoded_as>
    <field name="url">\.xml|\.soap|\.saml</field>
    <regex>(\?<?xml)|(<\?xml)</regex>
    <regex>(<[a-zA-Z_][a-zA-Z0-9_-]*:)</regex>
    <regex>(xmlns:[a-zA-Z_][a-zA-Z0-9_-]*\s*=)</regex>
    <description>CVE-2020-29511 - Potential Go encoding/xml namespace prefix exploitation attempt</description>
    <group>web_application_attack,</group>
    <mitre>
      <id>T1190</id>
      <name>Exploit Public-Facing Application</name>
    </mitre>
  </rule>
</group>

Mitigation & Patch Guidance

Patch Confidence: 1/4 — PARTIAL — No official Go language fix has been confirmed in the provided data. The only known mitigation is the use of a third-party validation module.

Immediate Mitigations:

  1. Input Validation: Integrate github.com/mattermost/xml-roundtrip-validator into applications that parse untrusted XML. This module verifies that round-trip tokenization preserves namespace semantics, rejecting inputs that would cause desynchronization.
  2. Restrict XML Sources: If XML processing is not essential, disable or block XML-based endpoints. For essential services, restrict untrusted XML input to authenticated/authorized clients only.
  3. Deploy WAF/IDS Rules: Use the detection rules above (Suricata/Sigma/Wazuh) to monitor for suspicious namespace pattern abuse.

Patch/Upgrade Steps:

  1. Monitor the Go issue tracker and security advisories for a confirmed fix in a future Go release.
  2. When an official fix is published, upgrade all Go toolchains and rebuild affected applications.
  3. Audit third-party Go dependencies that may have vendored or forked the encoding/xml package; apply the upstream fix to those forks as well.

Long-Term Hardening:

  1. Adopt XML validation libraries: Use libraries that strictly enforce W3C namespace compliance and reject ambiguous documents.
  2. Eliminate XML where possible: Prefer JSON/YAML over XML for new development; XML introduces parser-level complexity that is hard to secure.
  3. Runtime monitoring: Continuously monitor for differential-parsing anomalies; any case where a validation stage and a consumption stage disagree on inputs should trigger alarms.
  4. Security audits: Include parser-level attacks (namespace confusion, entity expansion, external entity references) in periodic code review and penetration testing cycles.

Threat Actor Evidence: Insufficient technical detail available — no confirmed active exploitation campaigns are documented in the provided data. The EPSS score (0.01942, 78.2nd percentile) suggests moderate propagation of exploit research activity, and the lack of CISA KEV listing indicates no government-confirmed in-the-wild exploitation to date.


References

  1. NVD Entry: CVE-2020-29511 — https://nvd.nist.gov/vuln/detail/CVE-2020-29511 — NVD Description of the encoding/xml namespace prefix round-trip flaw.
  2. Mattermost xml-roundtrip-validator: https://github.com/mattermost/xml-roundtrip-validator — The referenced third-party workaround module that validates XML round-trip semantics, confirming the vulnerability class and providing an emergency mitigation.
  3. EPSS Score Reference: https://www.first.org/epss — EPSS data for CVE-2020-29511 (EPSS score 0.01942, percentile 78.2%) indicating scanning/interest activity.
  4. Go Standard Library encoding/xml Documentation: https://pkg.go.dev/encoding/xml — Official documentation of the affected package, useful for understanding tokenizer behavior.
  5. CISA KEV (Known Exploited Vulnerabilities): https://www.cisa.gov/known-exploited-vulnerabilities-catalog — Searchable database confirming this CVE is NOT listed in the KEV catalog, indicating no confirmed in-the-wild exploitation as of the data date.

No threat-actor campaign attributions or confirmed exploit-in-the-wild evidence is available in the provided data.

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2020-29511/ · 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.