Fossil SCM

In /raw and /secureraw, ensure that the "m" and "at" vars are fetched before the malice check. Typo fix in cgi.c.

stephan 2023-07-17 12:18 verify-options-cgi
Commit 83015b0d9ad35644a56a3a0e9a790cd566b86b91df824bbec2410bcc5f0e8b0a
2 files changed +3 -3 +4
+3 -3
--- src/cgi.c
+++ src/cgi.c
@@ -1542,16 +1542,16 @@
15421542
style_submenu_enable(0);
15431543
style_header("Malicious Query Detected");
15441544
@ <h2>Begone, Knave!</h2>
15451545
@ <p>This page was generated because Fossil detected an (unsuccessful)
15461546
@ SQL injection attack or other nefarious content in your HTTP request.
1547
- @
1547
+ @
15481548
@ <p>If you believe you are innocent and have reached this page in error,
1549
- @ contact the Fossil developers on the Fossil-SCM Forum. Type
1549
+ @ contact the Fossil developers on the Fossil-SCM Forum. Type
15501550
@ "fossil-scm forum" into any search engine to locate the Fossil-SCM Forum.
15511551
style_finish_page();
1552
- cgi_set_status(418,"I'm a teapotgrep ");
1552
+ cgi_set_status(418,"I'm a teapot");
15531553
cgi_reply();
15541554
fossil_errorlog("possible hack attempt - 418 response on \"%s\"", zName);
15551555
exit(0);
15561556
}
15571557
15581558
--- src/cgi.c
+++ src/cgi.c
@@ -1542,16 +1542,16 @@
1542 style_submenu_enable(0);
1543 style_header("Malicious Query Detected");
1544 @ <h2>Begone, Knave!</h2>
1545 @ <p>This page was generated because Fossil detected an (unsuccessful)
1546 @ SQL injection attack or other nefarious content in your HTTP request.
1547 @
1548 @ <p>If you believe you are innocent and have reached this page in error,
1549 @ contact the Fossil developers on the Fossil-SCM Forum. Type
1550 @ "fossil-scm forum" into any search engine to locate the Fossil-SCM Forum.
1551 style_finish_page();
1552 cgi_set_status(418,"I'm a teapotgrep ");
1553 cgi_reply();
1554 fossil_errorlog("possible hack attempt - 418 response on \"%s\"", zName);
1555 exit(0);
1556 }
1557
1558
--- src/cgi.c
+++ src/cgi.c
@@ -1542,16 +1542,16 @@
1542 style_submenu_enable(0);
1543 style_header("Malicious Query Detected");
1544 @ <h2>Begone, Knave!</h2>
1545 @ <p>This page was generated because Fossil detected an (unsuccessful)
1546 @ SQL injection attack or other nefarious content in your HTTP request.
1547 @
1548 @ <p>If you believe you are innocent and have reached this page in error,
1549 @ contact the Fossil developers on the Fossil-SCM Forum. Type
1550 @ "fossil-scm forum" into any search engine to locate the Fossil-SCM Forum.
1551 style_finish_page();
1552 cgi_set_status(418,"I'm a teapot");
1553 cgi_reply();
1554 fossil_errorlog("possible hack attempt - 418 response on \"%s\"", zName);
1555 exit(0);
1556 }
1557
1558
+4
--- src/info.c
+++ src/info.c
@@ -1858,10 +1858,12 @@
18581858
*/
18591859
void rawartifact_page(void){
18601860
int rid = 0;
18611861
char *zUuid;
18621862
1863
+ (void)P("at")/*for cgi_check_for_malice()*/;
1864
+ (void)P("m");
18631865
if( P("ci") ){
18641866
rid = artifact_from_ci_and_filename(0);
18651867
}
18661868
if( rid==0 ){
18671869
rid = name_to_rid_www("name");
@@ -1891,10 +1893,12 @@
18911893
*/
18921894
void secure_rawartifact_page(void){
18931895
int rid = 0;
18941896
const char *zName = PD("name", "");
18951897
1898
+ (void)P("at")/*for cgi_check_for_malice()*/;
1899
+ (void)P("m");
18961900
cgi_check_for_malice();
18971901
login_check_credentials();
18981902
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
18991903
rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", zName);
19001904
if( rid==0 ){
19011905
--- src/info.c
+++ src/info.c
@@ -1858,10 +1858,12 @@
1858 */
1859 void rawartifact_page(void){
1860 int rid = 0;
1861 char *zUuid;
1862
 
 
1863 if( P("ci") ){
1864 rid = artifact_from_ci_and_filename(0);
1865 }
1866 if( rid==0 ){
1867 rid = name_to_rid_www("name");
@@ -1891,10 +1893,12 @@
1891 */
1892 void secure_rawartifact_page(void){
1893 int rid = 0;
1894 const char *zName = PD("name", "");
1895
 
 
1896 cgi_check_for_malice();
1897 login_check_credentials();
1898 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
1899 rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", zName);
1900 if( rid==0 ){
1901
--- src/info.c
+++ src/info.c
@@ -1858,10 +1858,12 @@
1858 */
1859 void rawartifact_page(void){
1860 int rid = 0;
1861 char *zUuid;
1862
1863 (void)P("at")/*for cgi_check_for_malice()*/;
1864 (void)P("m");
1865 if( P("ci") ){
1866 rid = artifact_from_ci_and_filename(0);
1867 }
1868 if( rid==0 ){
1869 rid = name_to_rid_www("name");
@@ -1891,10 +1893,12 @@
1893 */
1894 void secure_rawartifact_page(void){
1895 int rid = 0;
1896 const char *zName = PD("name", "");
1897
1898 (void)P("at")/*for cgi_check_for_malice()*/;
1899 (void)P("m");
1900 cgi_check_for_malice();
1901 login_check_credentials();
1902 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
1903 rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", zName);
1904 if( rid==0 ){
1905

Keyboard Shortcuts

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