There is a chroot option, which should prevent dompdf from accessing files outside of configured root. However this option affects only the check for initial load of HTML in the "loadHtmlFile" method.
I can use the file protocol to load images (and stylesheets) outside of configured root without problems. For example <img src="file:///usr/lib/node_modules/npm/node_modules/qrcode-terminal/example/basic.png"> will load and display the image in generated PDF even though chroot is set to /usr/src/myapp/vendor/dompdf/dompdf.
This is a problem for us, because we allow (authenticated) users to configure their own PDF templates (for example for invoices). Meaning if someone inputs an image with a file protocol URL, they can access images that don't belong to them.
There is a chroot option, which should prevent dompdf from accessing files outside of configured root. However this option affects only the check for initial load of HTML in the "loadHtmlFile" method.
I can use the file protocol to load images (and stylesheets) outside of configured root without problems. For example
<img src="file:///usr/lib/node_modules/npm/node_modules/qrcode-terminal/example/basic.png">will load and display the image in generated PDF even though chroot is set to/usr/src/myapp/vendor/dompdf/dompdf.This is a problem for us, because we allow (authenticated) users to configure their own PDF templates (for example for invoices). Meaning if someone inputs an image with a file protocol URL, they can access images that don't belong to them.