Dashboard creation handler anchors filesystem paths on a client-supplied projectPath #441
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#441
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Security finding. Raised by the security review of IW-423 Phase 2. The behaviour predates that phase, which only changed the callee of one of the three operations sharing the anchor.
The hole
dashboard/jvm/src/CaskServer.scala:1219-1220takesprojectPathfrom the request form.:1250-1281then uses it as the anchor forin three operations: the worktree creation, the workspace creation, and the registration.
It is not checked against the server's registered project set. The only gate is that a readable
.iw/config.confmust exist at the supplied path (:1223-1233) — that proves the path looks like a project, not that it is one of ours.Lesson: a path taken from a request and used as a filesystem anchor needs an allow-list check against known projects, not only proof that it looks like a project.
Fix
Validate the creation handler's
projectPathagainst the server's registered projects before it is used as an anchor. The server already holds that set.Worth reviewing whether any other dashboard handler takes a path from a request and uses it the same way.
Recorded during IW-423; see
project-management/issues/IW-423/LESSONS.mdentry 19.Intake: needs-human
Workflow: diagnostic
Reason: G3 the Reproduction sections show no command that was run and no output; the analysis says the reproductions were traced from code only ("I did not run it for this analysis")
Analysis: project-management/issues/IW-441/analysis.md on branch IW-441