Summary
XML parsing in Slovensko.Digital Autogram fails to properly restrict XML External Entity (XXE) resolution in XMLUtils.java, enabling an attacker to abuse XML entities for SSRF and local file access.
When a victim's Autogram instance processes a specially crafted XML document sent to the /sign endpoint, a remote unauthenticated attacker can potentially pivot the parser to access internal network resources or read local files.
Affected context
This vulnerability arises in Slovensko.Digital Autogram deployments that expose a local HTTP server with a /sign endpoint and use XMLUtils.java to parse user-supplied XML.
The risk materializes when:
- XML input is accepted from external sources (e.g., browser-based clients, helper pages, or local web integrations),
- The XML parser is configured with entity resolution enabled or left at insecure defaults,
- There are reachable internal services or sensitive files accessible from the host running the application.
Exploit preconditions
- Attack surface: The
/signHTTP endpoint of the Autogram local server that accepts XML documents. - Required access: No prior authentication on the vulnerable endpoint; attacker only needs the ability to induce the victim's browser or environment to send a crafted request (e.g., via a malicious or compromised website).
- Trigger point: Submission of a specially crafted XML document containing external entities to the
/signendpoint, typically via a cross-origin request initiated when the victim visits the attacker-controlled page. - Why exploitation is possible: The XML parser in
XMLUtils.javais not hardened against external entity expansion and likely allows resolution ofSYSTEMor similar external entities. This lets user-controlled XML reference arbitrary URLs or local file paths, which the server then fetches or reads during parsing.
Why this happens
The core issue maps to CWE-611: Improper Restriction of XML External Entity Reference.
Insecure XML parser configuration in XMLUtils.java appears to:
- Allow external entity resolution and possibly DTD processing,
- Trust XML declarations from untrusted input,
- Fail to explicitly disable features like external general entities, external parameter entities, and DOCTYPE declarations.
When an XML parser processes such input, it may dereference attacker-controlled URIs or file paths as part of entity expansion.
This design treats XML structure as trusted configuration instead of untrusted data, allowing the attacker to coerce the application into making network calls (SSRF) or reading local files on behalf of the attacker.
Potential impact
- The application may perform Server-Side Request Forgery (SSRF), allowing network access to internal services not otherwise exposed.
- Attackers could read local files accessible to the Autogram process (e.g., configuration files, keys, or logs), subject to the OS and runtime permissions.
- Internal metadata services or admin endpoints reachable from the host could be queried, which may lead to credential exposure or further compromise.
- Combined with other weaknesses, SSRF or file disclosure could help attackers escalate privileges or move laterally in the environment.
General mitigation guidance
Mitigation generally focuses on hardening XML parsing and reducing trust in externally supplied XML:
- Configure XML parsers in
XMLUtils.javato disable: - DOCTYPE declarations,
- External general entities,
- External parameter entities,
- XInclude and other expansion mechanisms.
- Prefer safer data formats (e.g., JSON) for client-supplied payloads when feasible, or use XML libraries that are secure-by-default.
- Enforce strict schemas (XSD) without allowing external entity references, and validate XML against those schemas before processing.
- Minimize the filesystem and network privileges of the Autogram process so that, even if entity resolution occurs, reachable resources are limited.
- Treat all XML input as untrusted, regardless of whether it originates from local or browser-based clients, and centralize parser configuration to avoid insecure defaults.
How teams detect issues like this
Effective detection involves a combination of code-level and behavioral controls:
- Static analysis: Flag XML parser creation where features disabling external entities are not set, or where DTD processing is left enabled. Look for direct use of general-purpose XML parsers without secure configuration.
- Code review: Check
XMLUtils.javaand related utilities for: - Use of
DocumentBuilderFactory,SAXParserFactory, or similar APIs without explicit hardening, - Lack of calls that disable external entities and DOCTYPE.
- Security tests: Incorporate XXE test cases into integration tests by sending crafted XML with benign external entities and confirming they are not resolved.
- Runtime monitoring: Monitor outbound network requests from the Autogram host for unexpected destinations, as well as access to sensitive local paths when XML parsing endpoints are invoked.
- Automated SAST or application security testing tools can help identify insecure XML parsing patterns as part of the CI/CD pipeline.

