Skip to content

test(denkraum): cover loopback binding and CSRF controls (DR-SEC-01b) - #793

Merged
mergify[bot] merged 1 commit into
mainfrom
codex/dr-sec-01b-tests
Oct 9, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
codex/dr-sec-01b-tests

Conversation

@Cuarroc

@Cuarroc Cuarroc commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Zwei neue Tests prüfen die lokale Bindung des Denkraums und die Abwehr fremder Webanfragen.
Sie bestätigen die vorhandenen Schutzmaßnahmen und prüfen, dass abgewiesene Schreibanfragen keine Daten verändern.
Für dich ist jetzt nichts zu tun; Root übernimmt die weitere Prüfung dieses Entwurfs.

Report

Package: DR-SEC-01b · Operator: UMSETZEN (tests only) · Tier: C.
Authority / parent / ticket / owner: Root dispatch dated 2026-10-09, TEMPO-KERN / DR-SEC-01, b0221f4a, srv-dr-sec-01b.
Base: origin/main@b12ed64f38ae77328441ea5924e7ddfb81892be7, fetched before work; HEAD equalled this base.
Candidate: 6de3696a1bba86bb74c7e25f9671980f7ea069dd on codex/dr-sec-01b-tests.
Observed: 2026-10-09 UTC; remote head verified at 00:59 UTC.

What changed

  • Added only tools/denkraum/server-security.test.mjs: 129 added lines, within the 240-line budget. The existing test:denkraum glob includes it; no package manifest change.
  • P1: DRSEC: production entrypoint binds only IPv4 loopback executes the real server entrypoint synchronously in a bounded child process. Test instrumentation substitutes only an ephemeral port, preserves the production host argument, observes the actual socket address/family, then closes the server and waits for child exit. Complete synthetic startup configuration anticipates fix(denkraum): enforce full startup config and physical state boundary #750's preflight.
  • P2: DRSEC: CSRF guards reject cross-site and non-JSON mutations without writes sends real HTTP requests: foreign/null Origin with valid agent header; cross-site Fetch Metadata with matching/absent Origin and valid agent header; missing Origin/agent; form, multipart, text and absent Content-Type; OPTIONS without CORS grants. Ten rejected cases preserve exact ledger bytes and revision. Same-origin JSON and local-agent positive controls persist two additional questions.
  • In-memory sensitivity probes removed each Origin, Fetch-Metadata and Content-Type guard, and changed the startup bind to IPv6 wildcard. Each probe failed with an assertion (exit 1); probe driver exit 0. Source files were never edited for these experiments. These are test-sensitivity checks, not defects on main.
  • Commit trailer: No-Test: coverage-only tests for existing controls (DR-SEC-01b).
  • No runtime, dependency, architecture, seam or fix(denkraum): enforce full startup config and physical state boundary #750-owned file changes. No independent reviewer was started.

Bestätigte Lücken

None for P1/P2 at the recorded base: both tests passed against unchanged production code. No failing test was committed. This is bounded coverage, not a general security approval.

Evidence

All shell commands completed before handover; no detached worker or server remains from this package. Foreground commands yielded by the harness were awaited to completion.

Command Exit / result
git fetch origin; git log origin/main -1; git rev-list --left-right --count HEAD...origin/main 0; recorded base and 0 0 before edits
node --test tools/denkraum/server-security.test.mjs 0; 2 passed
npm run test:denkraum 0; 183 passed, 0 skipped; hygiene 37 files, 0 findings
In-memory node --input-type=module sensitivity probe using registerHooks and spawnSync driver 0; bind/Origin/Fetch-Metadata/Content-Type variants each 1 with ERR_ASSERTION
bash scripts/ci/secret-scan.sh 0; no leaks; also passed in commit hook
git diff --cached --check 0
git commit with stated trailer 0; precommit hook passed
bash scripts/ci/red-first.sh 0; accepted coverage-only No-Test classification
bash scripts/ci/gates.sh lane prepush 0, own worktree, HEAD 6de3696, 223 seconds; all listed gates green; Rust 1892 passed, 7 skipped
PA_PREPUSH=light git push -u origin codex/dr-sec-01b-tests 0; supported branchpush hook passed after full prepush at the same candidate
git ls-remote origin codex/dr-sec-01b-tests 0; exact candidate SHA
git status --short 0; clean

Initial and pre-build npm run dev:start-check: exit 0. After completed prepush, another check returned 1 for two other cargo builds, with 12.7 GB free; no additional compiler/test build was started. The supported light push hook ran without clippy or the Rust suite. Existing dependencies were sufficient.

Native goal and context evidence

get_goal initially returned goal: null; create_goal returned status: active for this ticket's bounded test/PR handover, scope, acceptance and #750 dependency. Milestone get_goal returned that same active objective after full prepush. Worker completion is the checked draft handover; parent acceptance, reviews and merge remain Root's work. Objective editing is not exposed by the goal tools.

lage-jetzt and its mirror are unavailable here. STAND, relevant PLAN entries, current PRs and Git history were checked. The tracked PLAN has no DR-SEC entry; the explicit dispatch supplies package authority. Actual model and provider quota were not independently observable.

NICHT ABGEDECKT

  • Linux only: #[cfg(windows)] tests and Windows clippy branches do not compile here; the Windows lane belongs to the merge queue. Seven Rust tests and two HQ tests were skipped by their existing configuration.
  • Prepush excludes browser smoke, frontend build and full workflow gates. No browser execution, live DNS/LAN attack, production ledger, webhook or external-service validation.
  • No claim about future fix(denkraum): enforce full startup config and physical state boundary #750 integration until its delta is checked. Binding coverage observes the production entrypoint; callers of the exported unbound factory still choose their own bind address.
  • No runtime fixes or coverage for the threat model's other proposals; Origin/agent headers do not authenticate hostile local processes.

Reviews and handover

Review: ausstehend (Stufe C); pending Root dispatch. No review findings or disposition are claimed.

State: implemented, tested, committed, pushed and remote-verified; submitted as draft. Not independently reviewed, accepted, merged or released. Root owns the next review/acceptance step, any reconciliation with #750, and eventual queue integration. No confirmed P1/P2 follow-up defect.

Root-Abnahme (09.10.2026, head 6de3696)

Tier C — new test file only (tools/denkraum/server-security.test.mjs, DR-SEC-01b P1/P2); both tests pass on unchanged production code (coverage of existing controls), no confirmed gap. Gates suffice, no external review required; worker evidence: own gates.sh lane prepush exit 0 and push verified with git ls-remote (see Report).

NICHT ABGEDECKT addendum: Windows lane comes from the merge queue.

No-Test: coverage-only tests for existing controls (DR-SEC-01b)
@mergify

mergify Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 2 merge protections satisfied — ready to merge.

Show 2 satisfied protections

🟢 Paket-PR bringt seinen Bericht mit

Package branches (w<N>-, df<N>, ki-<N>, hq2-, dr-, z<N>-) must carry their report in the PR body, in a section that starts with "## Report".

  • body ~= (?m)^## Report

🟢 🚦 Auto-queue

When all merge protections are satisfied and these conditions match, this pull request will be queued automatically.

  • -conflict
  • -draft
  • base = main
  • check-success = gates (linux)
  • check-success = gates (windows)
  • check-success = red-first
  • label != do-not-merge
  • label = review-ok

@Cuarroc
Cuarroc marked this pull request as ready for review October 9, 2026 01:16
@Cuarroc Cuarroc added the review-ok Pipeline: review disposition complete, no open high finding label Oct 9, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T01:18:10.202587Z 6de3696 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mergify mergify Bot added the queued label Oct 9, 2026
@mergify
mergify Bot merged commit f566da2 into main Oct 9, 2026
17 checks passed
@mergify
mergify Bot deleted the codex/dr-sec-01b-tests branch October 9, 2026 01:38
@mergify

mergify Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 16 minutes 17 seconds in the queue, including 16 minutes 2 seconds running CI.

Required conditions to merge
  • check-success = gates (linux)
  • check-success = gates (windows)
  • check-success = red-first
  • github-review-approved [🛡 GitHub repository ruleset rule main-pr-required-checks]
  • label != do-not-merge
  • all of [🛡 Merge Protections rule Paket-PR bringt seinen Bericht mit]:
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-success = @github-actions/gates (linux)
    • check-neutral = @github-actions/gates (linux)
    • check-skipped = @github-actions/gates (linux)
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-success = @github-actions/gates (windows)
    • check-neutral = @github-actions/gates (windows)
    • check-skipped = @github-actions/gates (windows)
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-success = @github-actions/red-first
    • check-neutral = @github-actions/red-first
    • check-skipped = @github-actions/red-first
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-neutral = @mergify/Mergify Merge Protections
    • check-skipped = @mergify/Mergify Merge Protections
    • check-success = @mergify/Mergify Merge Protections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-ok Pipeline: review disposition complete, no open high finding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant