Commit fbe9b77
committed
fix(wac): require Control on protected resource for POST-created .acl/.meta sidecars
A POST whose Slug resolves to an `.acl`/`.meta` sidecar is currently
authorized only against the *container* (the request path), because the
dedicated ACL Control guard in `auth/middleware.js` (`authorizeAclAccess`)
keys on `urlPath.endsWith('.acl')` — which never matches a container POST.
The sidecar filename is only produced *inside* `handlePost` via
`generateUniqueFilename`, after authorization has run.
Impact: an agent holding only `acl:Append` on a container (e.g. a
public-append inbox/upload directory created by `generateInboxAcl`) can
`POST` with `Slug: victim.acl` and write a resource ACL that grants itself
`acl:Control`/`acl:Read` on a sibling — privilege escalation to full
control of a resource it had no access to. The slug validator permits `.`,
so `victim.acl` passes.
Fix: in `handlePost`, when the resolved child filename ends in `.acl`/`.meta`,
require `acl:Control` on the protected resource (the sidecar path minus the
suffix) before writing, mirroring `authorizeAclAccess`. Owners (who hold
Control) are unaffected; Append-only agents get 403.
Found during a cross-implementation audit against the solid-pod-rs Rust port,
which shared the same gap and is fixed in lockstep. Reproduction and a
proposed regression test are in the PR description; the full integration
harness could not be exercised in the contributor's environment (missing
optional `@simplewebauthn/server` dep used by the passkey path at server
bootstrap), so CI validation is requested.
Co-Authored-By: jjohare <github@thedreamlab.uk>1 parent 10bd60f commit fbe9b77
1 file changed
Lines changed: 29 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
91 | 119 | | |
92 | 120 | | |
93 | 121 | | |
| |||
0 commit comments