mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
[enh] Add security comment
This commit is contained in:
parent
00e6b224cb
commit
60aca2f90d
1 changed files with 3 additions and 1 deletions
|
@ -327,7 +327,9 @@ function is_admin()
|
||||||
|
|
||||||
local token = token:gsub("\n","")
|
local token = token:gsub("\n","")
|
||||||
|
|
||||||
-- FIXME FIXME FIXME - this is a really stupid and time-attack-prone way to validate the token
|
-- LUA comparison are made in constant time thanks to interned string mechanism
|
||||||
|
-- It compare pointers and not char by char. SO no risk of timing attack here :)
|
||||||
|
-- See https://poprocks.dev/constant-time-string-comparison-in-lua/
|
||||||
if admin_token_header == token then
|
if admin_token_header == token then
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue