Summary
A server-side request forgery vulnerability in Plate's DOCX conversion component allows attacker-controlled HTML to cause requests to remote image URLs during document generation. When conversion runs in a server-side or privileged environment, an attacker may access internal resources, disclose fetched response data through the generated document, or consume excessive resources.
Affected context
The issue occurs in applications using the Plate DOCX conversion workflow through @platejs/docx-io, particularly when htmlToDocxBlob processes HTML that an attacker can influence. Risk increases when conversion executes on a server with access to internal network services, cloud metadata endpoints, sensitive hosts, or broad outbound connectivity.
Exploit preconditions
- Attack surface: Server-side DOCX conversion of attacker-controlled or insufficiently trusted HTML
- Required access: Ability to submit or influence HTML content processed by the converter
- Trigger point: Remote image handling during HTML-to-DOCX conversion
- Network condition: The conversion environment must be able to reach the targeted remote or internal resource
- Why exploitation is possible: The converter retrieves image URLs without adequately restricting destinations, and the fetched bytes may be embedded in the generated DOCX
Why this happens
The underlying bug is unrestricted server-side fetching of remote image URLs derived from untrusted HTML. This behavior maps to CWE-918: Server-Side Request Forgery, because attacker-controlled input influences network requests made by the application from a trusted server-side context. Returning the fetched image data in the generated document can also expose response content, while large or slow responses may increase resource consumption.
Potential impact
- Internal services or protected network endpoints may be accessed
- Response data from reachable resources could be disclosed through generated documents
- Cloud or infrastructure metadata may be exposed where network controls permit access
- Server resources may be consumed by large, slow, or numerous remote responses
- Downstream systems could be affected if the conversion service has excessive network privileges
General mitigation guidance
Mitigation generally focuses on reducing trust in user-supplied URLs and limiting the network authority of document conversion services.
Common defensive patterns include:
- Permit only explicitly approved URL schemes, hosts, and ports
- Prefer processing uploaded or locally controlled images over fetching arbitrary remote content
- Block loopback, link-local, private, and otherwise reserved address ranges after DNS resolution
- Revalidate destinations across redirects and protect against DNS rebinding
- Apply connection, response-size, timeout, and concurrency limits
- Isolate conversion workers from sensitive network segments and metadata services
- Run conversion processes with least-privilege identities and minimal outbound network access
- Avoid returning fetched content to untrusted users unless disclosure is intentional and controlled
How teams detect issues like this
Detection approaches can include:
- Static analysis for server-side HTTP clients whose URLs originate from HTML or other user-controlled fields
- Code review checks for image, resource, or asset fetchers that follow redirects without destination validation
- Tests covering private address ranges, loopback targets, alternate IP representations, and DNS changes
- Network monitoring for unexpected requests from document conversion workers to internal services
- Policy enforcement requiring egress restrictions, URL allowlists, and resource limits for conversion workloads
- Automated security review tools that identify SSRF-prone data flows and unrestricted outbound requests

