Fossil SCM
checkin/26b61eb3223648f308cacae742cd46298b573c778630c43a2b1005694df193a5
5 days, 14 hours ago by dmestas
Overread of the login cookie
login_check_credentials() in src/login.c splits the login cookie at its
slashes. When a slash was the last character of the cookie, the parse stepped
past the end of its copy, then read beyond it and wrote a zero byte there. A
request to any page can carry any cookie, so no login was needed.
The fix stops at a slash that ends the cookie.
Tested with ASan and UBSan on macOS: the cookies ASan stopped on before the fix
now give the page as user nobody with no report, and logins by form, cookie,
HTTP Basic and token work as before. The tests are in test/login.test, which
will come with the test-suite work. Not run on Linux or Windows.