Fossil SCM

Improved comments on the SQL protection subsystem.

drh 2022-12-29 20:09 trunk
Commit 0aa3483fa89b6226fab3aca264cbd85e2f3db67b4d92d4d718f4412fb2c31dc9
1 file changed +12 -2
+12 -2
--- src/db.c
+++ src/db.c
@@ -369,15 +369,15 @@
369369
** This is *not* a primary means of defending the application from
370370
** attack. Fossil should be secure even if this mechanism is disabled.
371371
** The purpose of database write protection is to provide an additional
372372
** layer of defense in case SQL injection bugs somehow slip into other
373373
** parts of the system. In other words, database write protection is
374
-** not primary defense but rather defense in depth.
374
+** not the primary defense but rather defense in depth.
375375
**
376376
** This mechanism mostly focuses on the USER table, to prevent an
377377
** attacker from giving themselves Admin privilegs, and on the
378
-** CONFIG table and specially "sensitive" settings such as
378
+** CONFIG table and especially "sensitive" settings such as
379379
** "diff-command" or "editor" that if compromised by an attacker
380380
** could lead to an RCE.
381381
**
382382
** By default, the USER and CONFIG tables are read-only. Various
383383
** subsystems that legitimately need to change those tables can
@@ -399,10 +399,20 @@
399399
** The PROTECT_SENSITIVE protection is a subset of PROTECT_CONFIG
400400
** that blocks changes to all of the global_config table, but only
401401
** "sensitive" settings in the config table. PROTECT_SENSITIVE
402402
** relies on triggers and the protected_setting() SQL function to
403403
** prevent changes to sensitive settings.
404
+**
405
+** PROTECT_READONLY is set for any HTTP request for which the HTTP_REFERER
406
+** is not the same origin. This is an additional defense against cross-site-
407
+** scripting attacks. As with all of these defenses, this is only an extra
408
+** backup layer. Fossil should be proof against XSS attacks even without this.
409
+**
410
+** Any violation of these security restrictions results in a SECURITY message
411
+** in the server log (if enabled). A violation of any of these restrictions
412
+** probably indicates a bug in Fossil and should be reported to the
413
+** developers.
404414
**
405415
** Additional Notes
406416
** ----------------
407417
**
408418
** Calls to routines like db_set() and db_unset() temporarily disable
409419
--- src/db.c
+++ src/db.c
@@ -369,15 +369,15 @@
369 ** This is *not* a primary means of defending the application from
370 ** attack. Fossil should be secure even if this mechanism is disabled.
371 ** The purpose of database write protection is to provide an additional
372 ** layer of defense in case SQL injection bugs somehow slip into other
373 ** parts of the system. In other words, database write protection is
374 ** not primary defense but rather defense in depth.
375 **
376 ** This mechanism mostly focuses on the USER table, to prevent an
377 ** attacker from giving themselves Admin privilegs, and on the
378 ** CONFIG table and specially "sensitive" settings such as
379 ** "diff-command" or "editor" that if compromised by an attacker
380 ** could lead to an RCE.
381 **
382 ** By default, the USER and CONFIG tables are read-only. Various
383 ** subsystems that legitimately need to change those tables can
@@ -399,10 +399,20 @@
399 ** The PROTECT_SENSITIVE protection is a subset of PROTECT_CONFIG
400 ** that blocks changes to all of the global_config table, but only
401 ** "sensitive" settings in the config table. PROTECT_SENSITIVE
402 ** relies on triggers and the protected_setting() SQL function to
403 ** prevent changes to sensitive settings.
 
 
 
 
 
 
 
 
 
 
404 **
405 ** Additional Notes
406 ** ----------------
407 **
408 ** Calls to routines like db_set() and db_unset() temporarily disable
409
--- src/db.c
+++ src/db.c
@@ -369,15 +369,15 @@
369 ** This is *not* a primary means of defending the application from
370 ** attack. Fossil should be secure even if this mechanism is disabled.
371 ** The purpose of database write protection is to provide an additional
372 ** layer of defense in case SQL injection bugs somehow slip into other
373 ** parts of the system. In other words, database write protection is
374 ** not the primary defense but rather defense in depth.
375 **
376 ** This mechanism mostly focuses on the USER table, to prevent an
377 ** attacker from giving themselves Admin privilegs, and on the
378 ** CONFIG table and especially "sensitive" settings such as
379 ** "diff-command" or "editor" that if compromised by an attacker
380 ** could lead to an RCE.
381 **
382 ** By default, the USER and CONFIG tables are read-only. Various
383 ** subsystems that legitimately need to change those tables can
@@ -399,10 +399,20 @@
399 ** The PROTECT_SENSITIVE protection is a subset of PROTECT_CONFIG
400 ** that blocks changes to all of the global_config table, but only
401 ** "sensitive" settings in the config table. PROTECT_SENSITIVE
402 ** relies on triggers and the protected_setting() SQL function to
403 ** prevent changes to sensitive settings.
404 **
405 ** PROTECT_READONLY is set for any HTTP request for which the HTTP_REFERER
406 ** is not the same origin. This is an additional defense against cross-site-
407 ** scripting attacks. As with all of these defenses, this is only an extra
408 ** backup layer. Fossil should be proof against XSS attacks even without this.
409 **
410 ** Any violation of these security restrictions results in a SECURITY message
411 ** in the server log (if enabled). A violation of any of these restrictions
412 ** probably indicates a bug in Fossil and should be reported to the
413 ** developers.
414 **
415 ** Additional Notes
416 ** ----------------
417 **
418 ** Calls to routines like db_set() and db_unset() temporarily disable
419

Keyboard Shortcuts

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