Blind Trust What Is Hidden Behind the Process of Creating Yo... #1721
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
This blog post presents a deep-dive into security issues in HTML-to-PDF generators, focusing on the PHP libraries
tecnickcom/TCPDFandspipu/html2pdf. The authors build a clear threat model: a PDF renderer typically sits at a trust boundary, parsing attacker-controlled HTML, loading images, SVGs, fonts, certificates, and external CSS, while having access to the local filesystem and internal network. They use two concrete files on the server to demonstrate impact:🔧 Technical Details
1. Path traversal via SVG
xlink:hrefin PDF enginesIf a PDF library accepts untrusted HTML with embedded SVGs, and its SVG handler reads
<image xlink:href="...">into a filesystem path without robust traversal checks, an attacker can reference files with sequences like../../... By embedding the SVG as a data URI (e.g.<img src="data:image/svg;base64,...">), the attacker can cause the renderer to load local files (e.g./tmp/user_files/user_1/private_image.png) and embed them into the PDF. Where libraries prependDOCUMENT_ROOTto paths starting with/, attackers can still use/../../..to escape into arbitrary directories.2. Bypassing naive
"../"filters with URL-encodingMany libraries attempt to block traversal by checking if a string contains
"../"before accessing the filesy...🤖 Agent Actions
Summary:
Tests: Not run (documentation-only changes).
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.