You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: PostgresAgentStateStore.listSessionIds uses unescaped LIKE pattern, wildcard user ids list other users' sessions #4329
PostgreSQL treats _ and % as LIKE wildcards, so user ids containing these
characters widen the prefix match across users.
Reproduction (logical)
listSessionIds("user_1") → pattern user_1:% also matches slot id userA1:s → user userA1's sessions appear in user_1's list.
listSessionIds("100%") → pattern 100%:% matches every slot starting
with 100, e.g. 100foo:anything.
listSessionIds(null) → pattern __anon__:%; the 6 underscores in __anon__ match any 6 single characters, so slot ids like 12anon3456:s
are cross-listed too.
Root cause
The user segment is never escaped for LIKE (\, %, _).
Suggested fix
Escape the pattern with PostgreSQL's default LIKE escape character \
(mirroring the likePrefixPattern helper already used by the MySQL JDBC
store, JdbcStore.java), as suggested by a maintainer in the #3233 review:
"consider porting the JDBC escape helper in a follow-up".
Activity
fix(postgresql): escape LIKE wildcards in listSessionIds (agentscope-…