mirror of
https://github.com/D-Modem/bbs.git
synced 2026-11-28 17:38:04 -08:00
Users have a level (0-255) and flags (A-Z). [level N] sections say what
a range of levels may do: time online a day (warned at 5 and 1 minutes,
hung up at the end; doors' limits cut to what is left), downloads a day
(counted by every way: the BBS, 3270, FTP, the API), and whether they
may post, mail (else only the sysop), chat, page, download, upload and
open doors.
Requirements ("30 F !X", "sysop") are put on message areas (reading and
posting), file areas (downloading and uploading), doors, menus and menu
items ("x = menu:extras Extras | 50 X"). They are checked in the core,
so the text BBS, 3270s, FTP, NNTP and the API keep them alike: an area a
user may not read is not listed, opened or found by number or
Message-ID.
New users start at new_user_level and are told they wait; the sysop
validates them on the BBS (V on the main menu), by bbs user
waiting/validate/level/flags, or by PATCH /api/v1/admin/users. Users
see their access in the profile and /api/v1/me; no one changes their
own. Drop files carry the caller's level.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
5.5 KiB
5.5 KiB
- Passwords are bcrypt (cost 12); unknown users take as long to refuse as
wrong passwords; failures wait
fail_delay;attemptsfailures hang up;throttle_failuresturns away an address or caller ID that keeps failing (or signing up). - Everything users write is cleaned before it is stored and again before it is shown: no escape sequences, control characters, C1 controls, bidirectional overrides or invalid UTF-8 reach another caller's terminal. On a 3270 these would become 3270 orders once in EBCDIC; go3270 does not filter them itself.
- Limits everywhere: name, subject and line lengths, message size, telnet
subnegotiations, session headers, rlogin fields, 64 KB for a 3270
screen's answer; timeouts for every step (telnet and TN3270 negotiation,
headers, the login, idle callers, writes to callers who stopped
reading);
max_nodescallers at once andmax_per_ipfrom one address. - The database is created 0600; unix sockets are made private and then
opened to
socket_mode, never wider in between. - Private mail is read only by its recipient (every query asks for the user's own); a locked account is said to be locked only to someone who knows its password.
- Telnet and rlogin carry passwords in the clear, as they always have: keep rlogin to 127.0.0.1 or a socket, and offer SSH beside telnet (or put telnet behind a VPN) where that matters.
- SSH: host keys made 0600 and refused when others may read them; modern
algorithms only unless
legacy = yes(whichbbs checkwarns about); passwords checked, throttled and delayed as a terminal's; a key logs in only its own user, only if not locked, and is decided by the key the client proved (never one it merely offered); keys are added only with the password (on the BBS) or a login's session (the API), not by an API key. Commands, SFTP, forwarding of any kind and second sessions are refused, and a client has 30 seconds to get to its shell. A modem line is as private as the phone network. - News: a reader's article is posted as its user whatever its From says,
with the BBS's own Message-ID, Date and Path; only the headers a reader
may choose (Subject, References, the body) are kept.
IHAVEis taken only from a peer'saccept_fromaddresses, and peers' articles are checked (the headers RFC 5536 requires, sizes of the article, its headers and lines) and cleaned before a caller sees them.tls = requiredrefusesAUTHINFObeforeSTARTTLS;noandoptionalmakebbs checkwarn. Commands, lines and articles are limited, and so are clients at once and from one address. - FidoNet: a link is known by its address and its password (CRAM-MD5; in the clear only if allowed); a wrong password waits and is refused, an address that is not a link is turned away, and a system calling with a link's address but not its password gets nothing. Packets are tossed only from a link's own inbound, only if from its address to ours, with its packet password if it has one. Received file names are reduced to a safe base name; files, sessions, packets, bundles and messages have size limits. Netmail's sender is what the message says, as anywhere in FidoNet: it is not proof of who wrote it.
- Doors: a DOS door runs in a container with no network, as the BBS's user, seeing only the doors' directory and its node's; the caller's line is joined to it only through COM1. Hanging up, the time limit and the idle time stop it. The drop files carry no password.
- Chat: what callers say is cleaned like anything else they write, and
limited (200 characters a line, 8 lines in 10 seconds); a caller pages
at most once a minute; a page's private room is the caller's and the
sysops' only.
page_commandruns without a shell, the caller's words as whole arguments. - Finger tells no addresses or caller IDs and forwards nothing; gopher
shows no message or file area unless the sysop names it (and
bbs checkwarns when they do), and its selectors are database records, not paths. Both limit connections at once and from one address, and time out. - The HTTP API: TLS by default (
bbs checkwarns when it is off on an address others reach); tokens of 32 random bytes kept only as hashes, never in URLs, limited by scope (sysoponly for sysops), expiring and revocable; rate limits per token and per address; JSON bodies limited and strict; one CORS origin at most, and WebSockets only from it and the API's own host. Metrics are on an address of their own. - Access levels: checked in the BBS's core, so the text BBS, 3270s, FTP,
NNTP and the API keep them alike; an area a user may not read is not
listed, opened, or found by a message's number or Message-ID; no user
changes their own level or flags (
PATCH /api/v1/merefuses them; only sysops' tokens reach/admin); a requirement that does not read shuts everyone but the sysop out. - The web terminal: the page's scripts only from the BBS (a Content
Security Policy: no inline scripts, no other hosts, no framing); its
WebSocket only from the BBS's own pages (or the
corsorigin), with the HTTP server's TLS, connection and rate limits; the caller logs in at the BBS's prompt like any terminal caller. - Screens: display files are read only from
screens_dir, by names of letters, digits,_and-(no paths), at most 256 KB. The values of @-codes are cleaned, so no escape sequence gets into a screen through a user's name or location. - The log has logins, failures, posts and mail sent (never passwords or message text).