Skip to content

Commit 1fc8eb5

Browse files
committed
Make sure that clients can't access buffers belonging to other users
A manipulated, but properly authenticated client was able to retrieve the backlog of other users on the same core in some cases by providing an appropriate BufferID to the storage engine. Note that proper authentication was still required, so exploiting this requires malicious users on your core. This commit fixes this issue by ensuring that foreign BufferIDs are off-limits.
1 parent 03c4c31 commit 1fc8eb5

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
SELECT bufferid, networkid, buffertype, groupid, buffername
22
FROM buffer
3-
WHERE bufferid = :bufferid
3+
WHERE userid = :userid AND bufferid = :bufferid

src/core/SQL/PostgreSQL/16/update_network.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ rejoinchannels = :rejoinchannels,
1717
usesasl = :usesasl,
1818
saslaccount = :saslaccount,
1919
saslpassword = :saslpassword
20-
WHERE networkid = :networkid
20+
WHERE userid = :userid AND networkid = :networkid
21+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
SELECT bufferid, networkid, buffertype, groupid, buffername
22
FROM buffer
3-
WHERE bufferid = :bufferid
3+
WHERE bufferid = :bufferid AND userid = :userid

0 commit comments

Comments
 (0)