Skip to content

Commit d742954

Browse files
committed
Fix XSS issue in a HTML attachment preview
Reported by aikido_security
1 parent 57dec0c commit d742954

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Security: Fix remote image blocking bypass via various SVG animate attributes
99
- Security: Fix remote image blocking bypass via a crafted body background attribute
1010
- Security: Fix fixed position mitigation bypass via use of !important
11+
- Security: Fix XSS issue in a HTML attachment preview
1112

1213
## Release 1.5.13
1314

program/include/rcmail_action.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,9 @@ public static function display_uploaded_file($file)
683683
header('Content-Type: ' . $file['mimetype']);
684684
header('Content-Length: ' . $file['size']);
685685

686+
// Use strict security policy to make sure no javascript is executed
687+
header("Content-Security-Policy: script-src 'none'");
688+
686689
if (isset($file['data']) && is_string($file['data'])) {
687690
echo $file['data'];
688691
}

0 commit comments

Comments
 (0)