Title: WAC returns 403 for path-based pod access when subdomains enabled · Issue #144 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: WAC returns 403 for path-based pod access when subdomains enabled · Issue #144 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: WAC returns 403 for path-based pod access when subdomains enabled · Issue #144 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Bug With subdomains: true and baseDomain: "example.com", accessing a pod resource via path-based URL (example.com/alice/public/file.ttl) returns 403 Forbidden even when the ACL grants public Read access. Accessing via subdomain (alice.ex...
Open Graph Description: Bug With subdomains: true and baseDomain: "example.com", accessing a pod resource via path-based URL (example.com/alice/public/file.ttl) returns 403 Forbidden even when the ACL grants public Read a...
X Description: Bug With subdomains: true and baseDomain: "example.com", accessing a pod resource via path-based URL (example.com/alice/public/file.ttl) returns 403 Forbidden even when the ACL grants pub...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/144
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"WAC returns 403 for path-based pod access when subdomains enabled","articleBody":"## Bug\n\nWith `subdomains: true` and `baseDomain: \"example.com\"`, accessing a pod resource via path-based URL (`example.com/alice/public/file.ttl`) returns 403 Forbidden even when the ACL grants public Read access.\n\nAccessing via subdomain (`alice.example.com/public/file.ttl`) works correctly.\n\n## Cause\n\nIn `src/auth/middleware.js` line 59, the WAC middleware constructs the resource URL from the request hostname:\n\n```js\nconst resourceUrl = `${request.protocol}://${request.hostname}${urlPath}`;\n```\n\nFor path-based access on the main domain, this produces:\n- `https://example.com/alice/public/file.ttl`\n\nBut ACLs (generated during pod creation) reference subdomain-form URLs:\n- `acl:accessTo \u003chttps://alice.example.com/public/>`\n- `acl:default \u003chttps://alice.example.com/public/>`\n\nThe WAC checker compares the path-based URL against the subdomain-based ACL and finds no match, denying access.\n\n## Fix\n\nNormalize path-based URLs to subdomain form when subdomains are enabled:\n\n```js\nlet resourceUrl = `${request.protocol}://${request.hostname}${urlPath}`;\nif (request.subdomainsEnabled && request.baseDomain && \n request.hostname === request.baseDomain && !request.podName) {\n const pathMatch = urlPath.match(/^\\/([^\\/]+)(\\/.*)$/);\n if (pathMatch) {\n resourceUrl = `${request.protocol}://${pathMatch[1]}.${request.baseDomain}${pathMatch[2]}`;\n }\n}\n```\n\nNote: The same fix should be applied to the parent container URL rewrite (line 78) for PUT/POST/PATCH on non-existent resources.\n\n## Steps to reproduce\n\n1. Enable `subdomains: true` and `baseDomain: \"example.com\"` in config\n2. Create a pod (e.g., `alice`) — ACLs are generated with subdomain URLs\n3. Add a file to `alice/public/` (which has public Read ACL)\n4. Access `https://example.com/alice/public/file.ttl` — 403 Forbidden\n5. Access `https://alice.example.com/public/file.ttl` — 200 OK","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-03-03T08:36:17Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/144"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f7ae3625-868b-a933-bcb9-15931ec6aec5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BBAC:C8358:2BAF36A:39CC5C5:6B03975E |
| html-safe-nonce | b81f8b0c65375222c8c69584d3fd5507cd7f7e625f6f263b215b62f7e63e25ad |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkFDOkM4MzU4OjJCQUYzNkE6MzlDQzVDNTo2QjAzOTc1RSIsInZpc2l0b3JfaWQiOiI0NTg1ODM4MTM4MjM2MzExMzkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 37cd547543ad8cdc0aeab9627ab05596d78aa025aaead7e62e17e6df2465be53 |
| hovercard-subject-tag | issue:4015407199 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/144/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f75372ddf9f3c2350c1a3d8f1bf775413c8ad626a0bb0999d040f070d05b27cd/JavaScriptSolidServer/JavaScriptSolidServer/issues/144 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f75372ddf9f3c2350c1a3d8f1bf775413c8ad626a0bb0999d040f070d05b27cd/JavaScriptSolidServer/JavaScriptSolidServer/issues/144 |
| og:image:alt | Bug With subdomains: true and baseDomain: "example.com", accessing a pod resource via path-based URL (example.com/alice/public/file.ttl) returns 403 Forbidden even when the ACL grants public Read a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width