Fix XSS issue in a HTML attachment preview

Reported by aikido_security
This commit is contained in:
Aleksander Machniak
2026-03-18 10:23:34 +01:00
parent 57dec0c127
commit d742954ccb
2 changed files with 4 additions and 0 deletions

View File

@@ -683,6 +683,9 @@ abstract class rcmail_action
header('Content-Type: ' . $file['mimetype']);
header('Content-Length: ' . $file['size']);
// Use strict security policy to make sure no javascript is executed
header("Content-Security-Policy: script-src 'none'");
if (isset($file['data']) && is_string($file['data'])) {
echo $file['data'];
}