security audit and OWASP ZAP CI #105
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/starintel-server!105
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/security-audit-zap-ci"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
star:inteladministrator credentialadminor broader-scope credentialsadminscope, not the descriptive principal-type string/tmpmarker is created inside the disposable serverstarintel-zap-*disposable Compose project withSTAR_SECURITY_DISPOSABLE=1Security rationale
The audit found four privilege-boundary failures:
credentials:createcould request arbitrary scopes and principal type, including anadministratorcredential withadmin. Lifecycle capabilities could also rotate a more privileged credential and receive its replacement secret.ownerbecomes the authenticated principal ID, but delegated creation accepted any owner. A credential issuer could therefore mint a same-scope key as another principal and bypass identity/ownership checks. Lifecycle operations had the same cross-identity problem.administrator-principal-ptreated the descriptive principal typeadministratoras authority even withoutadminscope, while the central policy engine used scope-based authority. The bulk-job status path used that helper for its ownership bypass.This branch removes those privilege paths and now actively tests hostile input against the deployed CI image. Lisp injection probes are non-destructive canaries: successful execution only writes a marker under
/tmp, which is still treated as proof of RCE. CouchDB tests use two datasets with the same search fixture and fail if a restricted principal can retrieve the denied document through Lucene/Clouseau syntax manipulation. DoS probes are deliberately bounded and run only against the disposable stack.The remaining audit findings are deliberately documented rather than hidden: direct HTTP bearer transport has no in-process TLS invariant,
must_change_passwordis still advisory, development auth bypass needs a loopback invariant, the application body limit is downstream of HTTP request materialization, and container/CI least privilege can be tightened further.Validation
GitHub CI is the validation environment for this branch. Existing Nix/unit/integration/container jobs plus the ZAP and hostile-input workflow must pass before this leaves draft.
RAGE/TDD failure evidence for the current repair transaction:
055c8bfdb5f291c764decd676c2163911e851021bash ./scripts/zap-ci.sh passivePOST /new/document/notereturned HTTP 422 before the hostile search probes could rununsupported_schema_version: Document schema version is not supportedscripts/security-negative-test.shhard-coded documentversion:"0.9.0", so the security harness had drifted from the server's canonical document specRepair commit
c7d01c49538e5ab980cf3a9c3af0266e984d888dnow discoversdoc_spec_versionfrom the server metadata endpoint and uses that value for all canonical document fixtures, while retaining the hostile-input assertions. It also emits the response body on fixture creation failure instead of hiding the reason behindcurl --fail.The branch then conflicted with #104/master, so current master
8f6e50701081f0335c7552082dba5ff392b859e5was merged explicitly. Current exact head is1c6f1efacc531d67a7d86a9dd29ee5d414bad38f; it is 0 commits behind master and preserves #104's client/admin systems/tests plus #105's security hardening. Fresh exact-head CI is in progress; do not merge or remove draft status until every required gate, especially ZAP, is green.Second-stage TDD evidence: the stale-schema harness defect is fixed, and the hostile suite now exposes a real server boundary defect.
At exact branch head
6cba035145d7a4b5b8c35d77a64596e4f3494f3b(PR merge ref83f7875de3be3314e9be79b4459a01593e1b7db4), OWASP ZAP Security run32693397947, job97331044353, reached the malformed-JSON phase after stack health, delegated credential checks, scoped CouchDB/Clouseau fixtures, search injection, and view-path probes all succeeded.The deterministic regression is now:
malformed JSON probe trailing-comma expected 400, got HTTP 200The request used the valid canonical document schema version
0.8.0; the server accepted and normalized it as{"_id":"security-json-comma","dataset":"security-a","dtype":"note","version":"0.8.0"}. This proves malformed JSON is reaching successful document handling rather than being rejected at the HTTP syntax boundary.Per the StarIntel human-gated ADADR policy, no parser implementation is being added to this PR yet. The research transaction is now
lost-rob0t/starintel-auto-research#142/STAR-RESEARCH-041 Strict JSON HTTP Boundary, with research approval PENDING, architecture NOT STARTED, and implementation BLOCKED until explicit operator research approval, subsequent design/adversarial review, and separate design approval.Keep this PR draft/red. Do not weaken the
expected 400regression to make ZAP green.RAGE freshness reconciliation (2026-08-25): the trailing-comma RED evidence on this PR is no longer sufficient to establish a defect on current
master.The immutable failure remains valid for head
6cba035145d7a4b5b8c35d77a64596e4f3494f3b/ ZAP run32693397947, but currentmasteris now52948721d8981e9aa5ccad4efd77185e52af845bafter #119. This branch has diverged substantially from that master (merge base8f6e50701081f0335c7552082dba5ff392b859e5; current-master side is 74 commits beyond the #105 head in the compare).More importantly, current master changed the HTTP parser boundary:
source/frontends/http-boundary-core.lispnow decodes UTF-8, validates the raw JSON text withyason:parse, and only then converts it to the existing JSOWN representation. That is directly relevant to the old failure mode where permissive JSOWN parsing accepted a trailing comma. Current master also has amalformed-json-is-a-400-client-errorunit regression, although it currently uses a truncated{fixture rather than the exact trailing-comma payload.Therefore do not implement a parser fix from the old RED badge and do not merge/rebase this security branch wholesale. The next TDD action is to re-prove the exact trailing-comma regression against current master
52948721...(preferably the smallestparse-json-octetsfixture plus the deployed HTTP/ZAP probe). If current master returnsmalformed_json/HTTP 400, record #119 as observed superseding implementation evidence and reconcile STAR-RESEARCH-041 without fabricating approval. If it still returns 200, preserve the RED evidence and continue through the existing human-gated ADADR transaction.WIP: security audit and OWASP ZAP CIto security audit and OWASP ZAP CIView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.