From 673b4e1698a83c7c045a7dbff062a38740e3c750 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 11 Aug 2008 09:59:44 +0000 Subject: libs/web: Add an additional sanity check to Session IDs --- libs/web/luasrc/dispatcher.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua index b74c5bdc2..ca507bebd 100644 --- a/libs/web/luasrc/dispatcher.lua +++ b/libs/web/luasrc/dispatcher.lua @@ -172,7 +172,8 @@ function dispatch(request) local authen = authenticator[track.sysauth_authenticator] local def = (type(track.sysauth) == "string") and track.sysauth local accs = def and {track.sysauth} or track.sysauth - local user = luci.sauth.read(luci.http.getcookie("sysauth")) + local sess = luci.http.getcookie("sysauth"):match("^[A-F0-9]+$") + local user = luci.sauth.read(sess) if not luci.util.contains(accs, user) then if authen then -- cgit v1.2.3