5 Commits
Author SHA1 Message Date
MoepchiandClaude Opus 5.5 f2d9115782 gateway: serialize write-then-rename per file
Every JSON store (ping, store, news, sync, admin auth, config) wrote to one
shared "<file>.tmp" and renamed it. Parallel requests raced on that path:
one rename won, the others failed with ENOENT, and overlapping writes could
leave a mangled file that reads as empty after a restart. Seen live from a
parallel /api/ping probe.

writeFileAtomic() in net.ts queues writes per file, so the last caller's
data always lands last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-28 00:23:20 +00:00
MoepchiandClaude Opus 5.5 deff678cfa Store: CSS filter bypasses via comments in strings and vendor prefixes
normalizeCss stripped /* */ without knowing about strings or escapes, so
content:"/*" ... "*/" hid a url() between them from the checks, and
-webkit-image-set( slipped past the function-name boundary. The checks
now run with and without comment stripping and allow a vendor prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-25 12:50:25 +00:00
MoepchiandClaude Opus 5.5 512366bc94 Gateway: ALLOWED_SERVERS ignored text after a bracketed host
stripPort("[allowed]evil.tld") returned "allowed", so the allowlist
accepted the host while the connector resolved and contacted evil.tld.
A bracketed host may now only be followed by :port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-25 12:49:15 +00:00
MoepchiandClaude Opus 5.5 5f9950a96b Gateway: no orphaned connectors on connect/close races
Message handlers on one WebSocket run concurrently. A connect awaiting the
previous connector's teardown could still spawn a new connector after the
socket closed, or two connects could both spawn and one got lost. Either
way the connector kept running outside MAX_CONNECTIONS and shutdown.

Each connect now detaches the previous connection before awaiting it and
only spawns if it is still the newest connect on an open socket; the
disconnect message and the close handler detach the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-25 12:45:41 +00:00
MoepchiandClaude Opus 5.5 ab588f5ca2 Gateway: test admin login, 2FA and password changes
npm test builds the gateway and runs it on a free port in a temp dir.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-25 12:17:53 +00:00