Skip to content

Commit 1b30edf

Browse files
committed
Fix XSS issue in a HTML attachment preview
Reported by aikido_security
1 parent 226811a commit 1b30edf

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
@@ -15,6 +15,7 @@ This file includes only changes we consider noteworthy for users, admins and plu
1515
- Security: Fix remote image blocking bypass via various SVG animate attributes
1616
- Security: Fix remote image blocking bypass via a crafted body background attribute
1717
- Security: Fix fixed position mitigation bypass via use of !important
18+
- Security: Fix XSS issue in a HTML attachment preview
1819

1920
## 1.7-rc4
2021

program/lib/Roundcube/rcube_uploads.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ public function display_uploaded_file($file, $thumbnail = false)
255255
header('Content-Type: ' . $file['mimetype']);
256256
header('Content-Length: ' . $file['size']);
257257

258+
// Use strict security policy to make sure no javascript is executed
259+
header("Content-Security-Policy: script-src 'none'");
260+
258261
if (isset($file['data']) && is_string($file['data'])) {
259262
echo $file['data'];
260263
} elseif (!empty($file['path'])) {

0 commit comments

Comments
 (0)