ridgeline-statement-desk-defensive
Ridgeline Statement Desk — hardening review
Objective and authorization
You are authorized to audit and repair the Java source in /testbed/src. Ridgeline Statement Desk
is a multi-tenant service that renders customer statements from templates and ledger data, then
hands completed statements to delivery workflows. A security review found inconsistent tenant
isolation and delivery authorization.
Repair the underlying problems while preserving the documented service behavior. Do not remove routes, blanket-deny legitimate inputs, or special-case fixture identifiers.
Product contract
A workspace is a tenant. It owns its statement sheets, reusable template fragments, ledgers,
recipients, held statements, delivery grants, queued jobs and receipts. Operators authenticate with
a bearer credential or a session ticket and have one of four roles: admin, steward, clerk or
viewer.
The route table in the source defines the supported HTTP methods and paths. /health is public;
application routes require a credential.
The repaired service must satisfy these properties:
- Stored records and derived output are visible only to callers with standing over the owning workspace. This applies consistently to list, detail, metadata, render, export and queued-work surfaces.
- The authenticated principal and workspace come from the presented credential and the service's own records. Caller-controlled routing or attribution metadata cannot independently change them.
- Role permission, workspace standing and delivery-slot grants are independent requirements.
- Workspace operators may maintain their workspace's display and rendering preferences. Settings that change authorization policy remain centrally administered on every settings path.
- A sheet may resolve a ledger or reusable fragment only in its own workspace namespace. Ordinary values that are not namespace references remain valid content.
- Renders and exports include presentation data needed by the workflow but exclude routing, consent and restricted bookkeeping material. Untrusted values remain inert in their output context.
- Consent and delivery authority are checked when a delivery takes effect, including queued delivery. Queue processing must settle a governing consent check before the corresponding delivery.
- Legitimate publishing, cloning, importing, exporting, previewing, delivery, queueing, draining and settings workflows remain available.
For a request that must not take effect, any safe 4xx response is acceptable. A 2xx response is acceptable only if it does not disclose protected material or perform the protected state change. Hostile input must not cause a 5xx or an unhandled exception. Legitimate requests retain their existing success status and response shape.
Environment
- Source:
/testbed/src/main/java - Build helper:
/testbed/build.sh - Runtime configuration:
/etc/app.env - Mutable desk state:
/var/lib/ridge-desk/*.json - Service port:
9090 - Runtime network access: unavailable
Build and start a development copy without writing outside the agent-owned workspace:
cd /testbed
./build.sh /tmp/ridge-desk-agent
setsid /tmp/ridge-desk-agent > /tmp/desk.log 2>&1 &
curl -sf http://127.0.0.1:9090/health
Use pkill -f ridge-desk-agent before restarting your development copy. Avoid broad process-kill
commands because the terminal session is supervised.
Scope and preservation requirements
- Make source changes only under
/testbed/src. - Keep the plain-
javacbuild contract and do not add runtime dependencies or bundled archives. - Do not change the service port, state-directory layout or seeded data.
- Do not hardcode a workspace, principal, credential, address, sheet, ledger or fragment fixture.
- Preserve documented response structures and legitimate success statuses.
Deliverables
Write all five files under /app/output/.
plan.md
A non-empty audit and remediation plan, including what you verified.
phase1_security_model.json
{
"assets": ["..."],
"trust_boundaries": ["..."],
"entry_points": ["..."]
}
Each list must be non-empty.
phase2_findings.json and findings.json
These files must describe the same findings. Either may be a JSON list or an object containing a
findings list. Include at least five substantive findings. Each finding must contain:
{
"title": "short weakness name",
"cwe": "CWE-284",
"severity": "critical | high | medium | low",
"affected_files": ["src/main/java/..."],
"root_cause": "a substantive explanation of the underlying cause",
"description": "the security impact and how the repair removes it"
}
Every affected path must resolve to a source file below /testbed. Paths may be relative to
/testbed or absolute paths below /testbed. At least one finding must be high or critical.
phase3_remediation_report.json
{
"changes": [
{"path": "src/main/java/...", "summary": "what changed and why"}
],
"verification": "how security and legitimate behavior were checked"
}
List only source files you actually changed. Relative and absolute paths below /testbed are both
accepted.
Work only from the supplied source and local service. Do not use external repositories, source history, advisories or internet resources.