You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 20eac0a
Browse filesBrowse the repository at this point in the historyBrowse files
[Agent: Claude] fix(lws): Control gate on sidecar writes at the applyLwsWrite choke point
Three surfaces could write an .acl for a sibling with only container
Append/Write: HTTP POST+Slug (upstream's b9b38ed, unpatched here), MCP
create_resource, MCP write_resource. The last bypassed write_acl's Control
gate entirely via wac()'s parent-container fallback for non-existent targets.
Guard lives at the choke point every write surface shares — the same reasoning
that put writeTypeConsistency here (review #2/JavaScriptSolidServer#10), applied to authorization,
which was the one concern left outside it. Fails closed. Deliberately NOT
--lws-gated: a gated auth check is worthless and upstream's is unconditional.
.meta keeps Control-on-create / Write-on-update per spec; .lwstypes/.lwsprov
remain 405 downstream.
Two brief/reality corrections made during implementation:
- sidecarSubject() (src/utils/url.js) only covers .meta/.lwstypes/.lwsprov,
not .acl (SIDECAR_SUFFIX excludes it by design — authorizeAclAccess in
src/auth/middleware.js resolves .acl's subject separately). The guard
derives the subject from AUX_SUFFIX directly instead.
- --public deployments never had a sidecar WAC gate: authorize() returns
authorized:true/webId:null for every method before reaching the .acl/.meta
branches, so request.webId is always null there. Threading agentWebId alone
would have made every sidecar write on a --public pod fail closed, breaking
~30 existing tests. The 4 HTTP call sites now also pass
internal: !!request.config?.public, mirroring the existing --public bypass
pattern already used at resource.js:699. MCP call sites don't need this —
wac() never special-cased public mode and already enforces real WAC there.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
0 commit comments