greenhouse: close data leaks and console UAF
This commit is contained in:
1 parent
4f70df55dd
commit
6b506c0d54
4 files changed
+65
-2
No files matched your search
@@ -196,13 +196,17 @@ class Handler(BaseHTTPRequestHandler):
|
||||
row = db.execute("SELECT * FROM plots WHERE id=?", (focus,)).fetchone()
|
||||
if row is None:
|
||||
return self.reply(404, {"error": "no focus"})
|
||||
if self.token(q) != row["token"]:
|
||||
return self.reply(403, {"error": "focus capability required"})
|
||||
return self.reply(200, {"anchor": anchor, "focus": focus,
|
||||
"projection": {**row_public(row), "biometric_note": row["note"]}})
|
||||
if path == "/api/spectrum":
|
||||
id_ = q.get("plot", [""])[0]
|
||||
row = db.execute("SELECT archive FROM plots WHERE id=?", (id_,)).fetchone()
|
||||
row = db.execute("SELECT token,archive FROM plots WHERE id=?", (id_,)).fetchone()
|
||||
if row is None:
|
||||
return self.reply(404, {"error": "unknown plot"})
|
||||
if self.token(q) != row["token"]:
|
||||
return self.reply(403, {"error": "capability required"})
|
||||
raw = row["archive"].encode()
|
||||
salt = mask(id_, len(raw))
|
||||
previous = 0
|
||||
|
||||
Reference in new issue
Block a user