Fossil SCM

Further adjustments to the default CSP to allow in-line images.

drh 2021-03-03 17:21 trunk
Commit c184d646c3e07259092aa668e6bf7edbeb27abc8e30c113c250a2d56b935415d
3 files changed +1 -1 +2 -2 +1 -1
+1 -1
--- src/db.c
+++ src/db.c
@@ -4218,11 +4218,11 @@
42184218
** the following default Content Security Policy is used:
42194219
**
42204220
** default-src 'self' data:;
42214221
** script-src 'self' 'nonce-$nonce';
42224222
** style-src 'self' 'unsafe-inline';
4223
-** img-src *;
4223
+** img-src * data:;
42244224
**
42254225
** The default CSP is recommended. The main reason to change
42264226
** this setting would be to add CDNs from which it is safe to
42274227
** load additional content.
42284228
*/
42294229
--- src/db.c
+++ src/db.c
@@ -4218,11 +4218,11 @@
4218 ** the following default Content Security Policy is used:
4219 **
4220 ** default-src 'self' data:;
4221 ** script-src 'self' 'nonce-$nonce';
4222 ** style-src 'self' 'unsafe-inline';
4223 ** img-src *;
4224 **
4225 ** The default CSP is recommended. The main reason to change
4226 ** this setting would be to add CDNs from which it is safe to
4227 ** load additional content.
4228 */
4229
--- src/db.c
+++ src/db.c
@@ -4218,11 +4218,11 @@
4218 ** the following default Content Security Policy is used:
4219 **
4220 ** default-src 'self' data:;
4221 ** script-src 'self' 'nonce-$nonce';
4222 ** style-src 'self' 'unsafe-inline';
4223 ** img-src * data:;
4224 **
4225 ** The default CSP is recommended. The main reason to change
4226 ** this setting would be to add CDNs from which it is safe to
4227 ** load additional content.
4228 */
4229
+2 -2
--- src/style.c
+++ src/style.c
@@ -547,11 +547,11 @@
547547
** default is used instead:
548548
**
549549
** default-src 'self' data:;
550550
** script-src 'self' 'nonce-$nonce';
551551
** style-src 'self' 'unsafe-inline';
552
-** img-src *;
552
+** img-src * data:;
553553
**
554554
** The text '$nonce' is replaced by style_nonce() if and whereever it
555555
** occurs in the input string.
556556
**
557557
** The string returned is obtained from fossil_malloc() and
@@ -560,11 +560,11 @@
560560
char *style_csp(int toHeader){
561561
static const char zBackupCSP[] =
562562
"default-src 'self' data:; "
563563
"script-src 'self' 'nonce-$nonce'; "
564564
"style-src 'self' 'unsafe-inline'; "
565
- "img-src *";
565
+ "img-src * data:";
566566
const char *zFormat;
567567
Blob csp;
568568
char *zNonce;
569569
char *zCsp;
570570
int i;
571571
--- src/style.c
+++ src/style.c
@@ -547,11 +547,11 @@
547 ** default is used instead:
548 **
549 ** default-src 'self' data:;
550 ** script-src 'self' 'nonce-$nonce';
551 ** style-src 'self' 'unsafe-inline';
552 ** img-src *;
553 **
554 ** The text '$nonce' is replaced by style_nonce() if and whereever it
555 ** occurs in the input string.
556 **
557 ** The string returned is obtained from fossil_malloc() and
@@ -560,11 +560,11 @@
560 char *style_csp(int toHeader){
561 static const char zBackupCSP[] =
562 "default-src 'self' data:; "
563 "script-src 'self' 'nonce-$nonce'; "
564 "style-src 'self' 'unsafe-inline'; "
565 "img-src *";
566 const char *zFormat;
567 Blob csp;
568 char *zNonce;
569 char *zCsp;
570 int i;
571
--- src/style.c
+++ src/style.c
@@ -547,11 +547,11 @@
547 ** default is used instead:
548 **
549 ** default-src 'self' data:;
550 ** script-src 'self' 'nonce-$nonce';
551 ** style-src 'self' 'unsafe-inline';
552 ** img-src * data:;
553 **
554 ** The text '$nonce' is replaced by style_nonce() if and whereever it
555 ** occurs in the input string.
556 **
557 ** The string returned is obtained from fossil_malloc() and
@@ -560,11 +560,11 @@
560 char *style_csp(int toHeader){
561 static const char zBackupCSP[] =
562 "default-src 'self' data:; "
563 "script-src 'self' 'nonce-$nonce'; "
564 "style-src 'self' 'unsafe-inline'; "
565 "img-src * data:";
566 const char *zFormat;
567 Blob csp;
568 char *zNonce;
569 char *zCsp;
570 int i;
571
+1 -1
--- www/defcsp.md
+++ www/defcsp.md
@@ -26,11 +26,11 @@
2626
2727
<pre>
2828
default-src 'self' data:;
2929
script-src 'self' 'nonce-$nonce';
3030
style-src 'self' 'unsafe-inline';
31
- img-src *;
31
+ img-src * data:;
3232
</pre>
3333
3434
The default is recommended for most installations. However,
3535
the site administrators can overwrite this default DSP using the
3636
[default-csp setting](/help?cmd=default-csp). For example,
3737
--- www/defcsp.md
+++ www/defcsp.md
@@ -26,11 +26,11 @@
26
27 <pre>
28 default-src 'self' data:;
29 script-src 'self' 'nonce-$nonce';
30 style-src 'self' 'unsafe-inline';
31 img-src *;
32 </pre>
33
34 The default is recommended for most installations. However,
35 the site administrators can overwrite this default DSP using the
36 [default-csp setting](/help?cmd=default-csp). For example,
37
--- www/defcsp.md
+++ www/defcsp.md
@@ -26,11 +26,11 @@
26
27 <pre>
28 default-src 'self' data:;
29 script-src 'self' 'nonce-$nonce';
30 style-src 'self' 'unsafe-inline';
31 img-src * data:;
32 </pre>
33
34 The default is recommended for most installations. However,
35 the site administrators can overwrite this default DSP using the
36 [default-csp setting](/help?cmd=default-csp). For example,
37

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button