Summary
Snipe-IT fails to HTML-escape the employee number when generating asset acceptance PDFs, allowing attacker-controlled markup to reach the TCPDF HTML renderer. An attacker with users.edit permission may cause the server to request internal services, cloud metadata endpoints, or external URLs when a victim signs an asset acceptance.
Affected context
The vulnerability occurs in Snipe-IT deployments that generate asset acceptance PDFs through TCPDF and allow users with users.edit permission to control or modify the employee_num field. Risk arises when the field is inserted into HTML without context-appropriate escaping and the resulting document is rendered in an environment with network access to internal or external resources.
Exploit preconditions
- Attack surface: Employee or asset acceptance PDF generation
- Required access: Permission to edit users, including the affected employee_num value
- Trigger point: PDF generation when a victim signs an asset acceptance
- Why exploitation is possible: Unescaped user-controlled content is interpreted as HTML by TCPDF, allowing server-side resource requests to be initiated during rendering
Why this happens
The underlying bug is a failure to apply output encoding before inserting user-controlled data into an HTML-processing context. Because the employee_num value reaches TCPDF's writeHTML() function without suitable HTML escaping, markup in that value can be interpreted rather than displayed as text. This behavior maps to CWE-918: Server-Side Request Forgery, because attacker-influenced URLs may cause the application server to initiate requests to destinations selected by the attacker.
Potential impact
- The server may make requests to internal services that are not publicly reachable
- Cloud metadata credentials or configuration data could be exposed
- Internal network topology or service behavior could be inferred
- External systems could receive requests originating from the Snipe-IT server
- Downstream services could be affected if they trust requests from the application environment
General mitigation guidance
Mitigation generally focuses on preserving data as data throughout document generation and reducing the server's ability to reach sensitive destinations.
Common defensive patterns include:
- Applying context-appropriate HTML escaping to employee and user-controlled fields before rendering
- Using structured PDF APIs or text-only rendering paths where HTML interpretation is unnecessary
- Validating and constraining URL-bearing content when links are an intended feature
- Restricting outbound network access from the application and PDF-rendering process
- Blocking access to cloud metadata endpoints and other sensitive network ranges
- Running the application with least-privilege network and service permissions
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying unescaped values passed to HTML or template renderers
- Code review checks for user-controlled fields reaching writeHTML(), template engines, or document converters
- Tests that verify special characters remain inert text in generated PDFs
- Egress monitoring for unexpected requests from the application or document-rendering process
- Network policies that alert on or deny access to metadata endpoints, loopback ranges, and private service networks
- Automated security review tools that flag server-side URL fetching and missing output encoding

