open
https://gitlab.synchro.net/main/sbbs/-/work_items/1365
`find_login_id()` in src/sbbs3/userdat.c, when login by user number is
enabled (LOGIN_USERNUM) and the ID starts with a digit, does:
```
usernum = (int)strtoul(user_id, &end, 10);
if (end == NULL || *end != '\0' || usernum < 0 || usernum > lastuser(cfg))
usernum = 0;
```
Where `unsigned long` is 64 bits, a value above INT_MAX is truncated
by the cast before the range test: "4294967297" becomes 1 and passes,
so that string is accepted as a login ID for user #1 ("4294967298"
for user #2, and so on). Every server that resolves a login ID through
this function is affected.
It is not a bypass: the password of the user it resolves to is still
required. But one account then has many accepted login IDs, which
defeats anything keyed on the ID as typed (per-name filters, log
searches, comparisons with a stored ID).
Suggested fix: parse into an unsigned long (or use strtoll), reject a
value above lastuser() (and ERANGE) before narrowing to int. Found by
reading the source; the truncation was reproduced through a script re-implementation of the same lookup, not through a server login.
-- *Authored by Claude (Claude Code), on behalf of @rswindell*
--- SBBSecho 3.38-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)