Fossil SCM

Omit the SameSite=strict specifier for the login cookie, since that prevents users from clicking a hyperlink on an email notification and then going directly to the relevant page and getting logged in.

drh 2023-09-18 17:13 csrf-defense-enhancement
Commit fc5b49e99083ac7e2762560a28e319eff46cbc9acc6087d07d7ad1819220e074
1 file changed +2 -3
+2 -3
--- src/cgi.c
+++ src/cgi.c
@@ -314,16 +314,15 @@
314314
if( g.zBaseURL!=0 && fossil_strncmp(g.zBaseURL, "https:", 6)==0 ){
315315
zSecure = " secure;";
316316
}
317317
if( lifetime!=0 ){
318318
blob_appendf(&extraHeader,
319
- "Set-Cookie: %s=%t; Path=%s; max-age=%d; HttpOnly; SameSite=strict;"
320
- " %s\r\n",
319
+ "Set-Cookie: %s=%t; Path=%s; max-age=%d; HttpOnly; %s\r\n",
321320
zName, lifetime>0 ? zValue : "null", zPath, lifetime, zSecure);
322321
}else{
323322
blob_appendf(&extraHeader,
324
- "Set-Cookie: %s=%t; Path=%s; HttpOnly; SameSite=strict; %s\r\n",
323
+ "Set-Cookie: %s=%t; Path=%s; HttpOnly; %s\r\n",
325324
zName, zValue, zPath, zSecure);
326325
}
327326
}
328327
329328
330329
--- src/cgi.c
+++ src/cgi.c
@@ -314,16 +314,15 @@
314 if( g.zBaseURL!=0 && fossil_strncmp(g.zBaseURL, "https:", 6)==0 ){
315 zSecure = " secure;";
316 }
317 if( lifetime!=0 ){
318 blob_appendf(&extraHeader,
319 "Set-Cookie: %s=%t; Path=%s; max-age=%d; HttpOnly; SameSite=strict;"
320 " %s\r\n",
321 zName, lifetime>0 ? zValue : "null", zPath, lifetime, zSecure);
322 }else{
323 blob_appendf(&extraHeader,
324 "Set-Cookie: %s=%t; Path=%s; HttpOnly; SameSite=strict; %s\r\n",
325 zName, zValue, zPath, zSecure);
326 }
327 }
328
329
330
--- src/cgi.c
+++ src/cgi.c
@@ -314,16 +314,15 @@
314 if( g.zBaseURL!=0 && fossil_strncmp(g.zBaseURL, "https:", 6)==0 ){
315 zSecure = " secure;";
316 }
317 if( lifetime!=0 ){
318 blob_appendf(&extraHeader,
319 "Set-Cookie: %s=%t; Path=%s; max-age=%d; HttpOnly; %s\r\n",
 
320 zName, lifetime>0 ? zValue : "null", zPath, lifetime, zSecure);
321 }else{
322 blob_appendf(&extraHeader,
323 "Set-Cookie: %s=%t; Path=%s; HttpOnly; %s\r\n",
324 zName, zValue, zPath, zSecure);
325 }
326 }
327
328
329

Keyboard Shortcuts

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