diff --git a/debian/patches/CVE-2019-18345_183456_183457 b/debian/patches/CVE-2019-18345_183456_183457 index 1935dcee..97422bd2 100644 --- a/debian/patches/CVE-2019-18345_183456_183457 +++ b/debian/patches/CVE-2019-18345_183456_183457 @@ -8,8 +8,6 @@ Subject: fix CVE-2019-18345 CVE-2019-18346 CVE-2019-18347 The fix was developed by nielsvangijzen Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946343 -diff --git a/htdocs/admin.php b/htdocs/admin.php -index b48b8558..3efe4b8a 100644 --- a/htdocs/admin.php +++ b/htdocs/admin.php @@ -1,4 +1,5 @@ @@ -18,7 +16,7 @@ index b48b8558..3efe4b8a 100644 require_once('./always.php'); require_once('classEditor.php'); require_once('classBrowser.php'); -@@ -25,7 +26,12 @@ require_once('interactive-page.php'); +@@ -25,7 +26,12 @@ $page_elements = array(); $code_file = sprintf( 'ui/%s-%s.php', $component, $action ); if ( ! @include_once( $code_file ) ) { @@ -32,8 +30,6 @@ index b48b8558..3efe4b8a 100644 include('page-header.php'); include('page-footer.php'); @ob_flush(); exit(0); -diff --git a/htdocs/always.php b/htdocs/always.php -index 3e457bee..cd223e7d 100644 --- a/htdocs/always.php +++ b/htdocs/always.php @@ -8,6 +8,47 @@ @@ -84,9 +80,6 @@ index 3e457bee..cd223e7d 100644 // Ensure the configuration starts out as an empty object. $c = (object) array(); $c->script_start_time = microtime(true); -diff --git a/inc/csrf_tokens.php b/inc/csrf_tokens.php -new file mode 100644 -index 00000000..9d05ec4e --- /dev/null +++ b/inc/csrf_tokens.php @@ -0,0 +1,119 @@ @@ -210,11 +203,9 @@ index 00000000..9d05ec4e + return (isset($_POST['csrf_token']) && verifyCsrf($_POST['csrf_token'])); +} \ No newline at end of file -diff --git a/inc/interactive-page.php b/inc/interactive-page.php -index 86c88898..c0e87389 100644 --- a/inc/interactive-page.php +++ b/inc/interactive-page.php -@@ -20,6 +20,9 @@ if ( isset($_SERVER['SCRIPT_NAME']) ) { +@@ -20,6 +20,9 @@ if ( $wiki_help == 'admin' ) { $wiki_help .= '/' . $_GET['t'] . '/' . $_GET['action']; } @@ -224,8 +215,6 @@ index 86c88898..c0e87389 100644 $wiki_help = 'w/Help/'.$wiki_help; } -diff --git a/inc/ui/collection-edit.php b/inc/ui/collection-edit.php -index 4fa778c9..81bffb0b 100644 --- a/inc/ui/collection-edit.php +++ b/inc/ui/collection-edit.php @@ -1,4 +1,5 @@ @@ -234,7 +223,7 @@ index 4fa778c9..81bffb0b 100644 // Editor component for collections $editor = new Editor(translate('Collection'), 'collection'); -@@ -65,6 +66,12 @@ if ( isset($privsql) ) { +@@ -65,6 +66,12 @@ $can_write_collection = ($session->AllowedTo('Admin') || (bindec($permissions->priv) & privilege_to_bits('DAV::bind')) ); } @@ -247,7 +236,7 @@ index 4fa778c9..81bffb0b 100644 dbg_error_log('collection-edit', "Can write collection: %s", ($can_write_collection? 'yes' : 'no') ); $pwstars = '@@@@@@@@@@'; -@@ -273,6 +280,7 @@ EOPRIV; +@@ -259,6 +266,7 @@ $submit_row = ''; } @@ -255,7 +244,7 @@ index 4fa778c9..81bffb0b 100644 $id = $editor->Value('collection_id'); $template = << $prompt_description: ##description.textarea.78x6## $submit_row @@ -263,7 +252,7 @@ index 4fa778c9..81bffb0b 100644