mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
[fix] prevent shell injections
This commit is contained in:
parent
d16f3f81d0
commit
c8c7fe7fc7
1 changed files with 1 additions and 1 deletions
|
@ -842,7 +842,7 @@ end
|
|||
function hash_password(password)
|
||||
-- TODO is the password checked by regex? we don't want to
|
||||
-- allow shell injection
|
||||
local mkpasswd = io.popen("mkpasswd --method=sha-512 '" ..password.."'")
|
||||
local mkpasswd = io.popen("mkpasswd --method=sha-512 '" ..password:gsub("'", "'\\''").."'")
|
||||
local hashed_password = "{CRYPT}"..mkpasswd:read()
|
||||
mkpasswd:close()
|
||||
return hashed_password
|
||||
|
|
Loading…
Add table
Reference in a new issue