Repository navigation
fix: IPv6 per-IP limits, and the security audit with its attack test (#330) - #331
Conversation
Found by attacking the hosted demo from outside on 14 Nov: after the sign-in challenge limit (60 per IP per hour) answered 429 over IPv6, the same machine still got 200 over IPv4, and the same for guest sign-ups. The limits were keyed on the full address. Two windows for a dual-stack client is a factor of two, but an IPv6 customer holds a whole /64 and can send every request from a new address, which would make the per-IP limits (guest sign-ups, guest runs, sign-in challenges) no limit at all. The /64 rotation itself was not tried; it follows from the key. ipKey() now maps an IPv6 address to its /64 and ::ffff:a.b.c.d to the IPv4 address. A client with both IPv4 and IPv6 still gets two windows. Tests: new "per-IP limits count an IPv6 address as its /64" (fails on the previous code, passes now). bun run typecheck clean; bun run test 166 tests, 165 pass, 0 fail, 1 skipped; bun run load 0 errors, 0 runs missing events, approvals resumed exactly once. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
…4 Nov attack test (#330) The team's own security work on the hosted demo, kept in the repository so anyone can repeat it: a Threagile model (15 technical assets, 16 threats mapped to STRIDE and OWASP Top 10:2025), six Sigma rules that use the journal as it is today, three draft rules that need an access log, five Nuclei templates that match on the wrong answer, an Osmedeus v5 workflow, and the results of attacking api.hellonear.xyz from outside. Validated: sigma check 0 errors; nuclei -validate passes; Threagile (Docker) parses the model and writes its report (52 risks). Not validated: the Osmedeus workflow (Osmedeus is not installed here); its steps were run by hand. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
…sted API (#330) The security section now says plainly what was done before submission: a review, a threat model and an attack test from outside, with a table of every attack tried and what the hosted API answered, the one gap it found (IPv6 addresses counted one by one, fixed in this branch) and what is still missing (refusals are not logged). It stays clear that this is the team's own audit and that no outside party has audited HelloNear. JUDGE.md links to it from "Contracts and proofs". Docs only; no tests affected. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
…un (#330) JUDGE.md now sums up the team's audit and the attack test in one table and gives two curl commands that show a refusal without an account (401 without a session, 403 from another origin; both checked against the hosted API). It links to the README section and docs/security/. Docs only; no tests affected. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
|
@Lexirieru looked at
Not checked: the hosted deploy of |
|
Live on the hosted demo:
|
|
Merged as b5197a0 with Axel's approval; the automatic deploy has run and #330 is closed. Checked from outside after the deploy (17:1x UTC, 14 Nov):
What is new on
@Lin1er the |
Closes #330.
What changed
fix(be): per-IP limits count an IPv6 address as its /64 (ipKeyinapps/be/src/demo.ts). Found by attacking the hosted demo: after the sign-in challenge limit answered 429 over IPv6, the same machine still got 200 over IPv4. An IPv6 customer holds a whole /64 and could send each request from a new address, so the per-IP limits (guest sign-ups, guest runs, sign-in challenges) would not have limited them. A client with both IPv4 and IPv6 still gets two windows.docs/security/: the Threagile threat model, Sigma detection rules, Nuclei templates, an Osmedeus workflow and the results of the attack test.Tests (local)
apps/be:bun run typecheckclean;bun run test166 tests, 165 pass, 0 fail, 1 skipped;bun run load0 errors, 0 runs missing events, approvals resumed exactly once.per-IP limits count an IPv6 address as its /64fails on the previous code and passes now.sigma check docs/security/rules/: 0 errors.nuclei -validate: all templates valid. Threagile (Docker): the model parses and the report is written.After the merge
The deploy restarts the backend, which clears the in-memory limit windows (as every deploy does).
@Lin1er could you look at the
ipKeychange, sinceapps/beis yours? @AncungAulia @Nabil-Aufa FYI, nothing changes in the web app or the landing page.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e