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
Podkey's fetch/XHR interceptors in `src/nip98-interceptor.js` and `src/injected.js` unconditionally overwrite the request's `Authorization` header, even when the page already set one (e.g., `Authorization: DPoP ` for Solid-OIDC).
Result: any page using Solid-OIDC — including the pilot app on `test.solid.social` — has its DPoP access token replaced by Podkey's NIP-98 signature. JSS then authenticates the request as `did:nostr:` instead of the user's real WebID, and ACL denies access to the user's own profile. User gets 403 on writes.
All of these unconditionally assign `Authorization` without checking whether the page already set one.
Fix
Before injecting, check if an `Authorization` header is already present. If yes, skip Podkey's injection — the page is already authenticating itself and Podkey shouldn't interfere.
The 401-retry path is different: if the page's own Authorization failed (401), Podkey can retry with NIP-98 (this behavior stays). The fix is specifically about the initial request.
Workaround
Disable Podkey (or use incognito) when using Solid-OIDC apps. Not acceptable long-term.
Mostly fixed by #6; two cases remain at bd39ce8, so leaving this open.
Fixed: XHR (src/nip98-interceptor.js:230-238), and fetch with a Headers object, a tuple array, a plain object in any case, or a Request input with no init.
Still broken:
fetch(requestWithDPoP, { headers: undefined }). The check at src/nip98-interceptor.js:52 uses hasOwnProperty('headers'), so an explicit undefined counts as "init has headers", the Request's own Authorization is not looked at, and DPoP is replaced with Nostr …. Fix: treat init.headers === undefined as absent.
The 401 retry builds { ...options } (src/nip98-interceptor.js:205-206). The copy is shallow, so setAuthorizationOnOptions deletes the page's own Authorization key from the caller's headers object and writes the Nostr header in its place. The page's next request with that object carries a stale Nostr token instead of its DPoP token. Fix: copy the headers as well as init before writing to them, on both the first attempt and the retry.
The second point is the same root cause as follow-up 1 on #34.
Fixed in 0.0.13 (a2265b7). init.headers === undefined counts as absent, so a Request's own Authorization is respected, and Podkey copies the options and headers before signing and never writes into the caller's objects, on the first attempt or the 401 retry. Tests build a real Request so header replacement is visible.
Activity
Don't overwrite existing Authorization headers (#5)
Don't overwrite existing Authorization headers (#5)
Don't overwrite existing Authorization headers (#5)
Don't overwrite existing Authorization headers (#5)
Don't overwrite existing Authorization headers (#5)
Don't overwrite existing Authorization headers (#5)
Don't overwrite existing Authorization headers (#5)
Don't overwrite existing Authorization headers (#5)
Merge pull request #6 from JavaScriptSolidServer/issue-5-respect-exis…
jjohare commentedon Nov 28, 2026
Mostly fixed by #6; two cases remain at bd39ce8, so leaving this open.
Fixed: XHR (
src/nip98-interceptor.js:230-238), and fetch with aHeadersobject, a tuple array, a plain object in any case, or aRequestinput with noinit.Still broken:
fetch(requestWithDPoP, { headers: undefined }). The check atsrc/nip98-interceptor.js:52useshasOwnProperty('headers'), so an explicitundefinedcounts as "init has headers", theRequest's ownAuthorizationis not looked at, and DPoP is replaced withNostr …. Fix: treatinit.headers === undefinedas absent.{ ...options }(src/nip98-interceptor.js:205-206). The copy is shallow, sosetAuthorizationOnOptionsdeletes the page's ownAuthorizationkey from the caller's headers object and writes the Nostr header in its place. The page's next request with that object carries a stale Nostr token instead of its DPoP token. Fix: copy the headers as well asinitbefore writing to them, on both the first attempt and the retry.The second point is the same root cause as follow-up 1 on #34.
Page side: dynamic content scripts, state-driven bridge, interceptor …
jjohare commentedon Nov 28, 2026
Fixed in 0.0.13 (a2265b7).
init.headers === undefinedcounts as absent, so aRequest's ownAuthorizationis respected, and Podkey copies the options and headers before signing and never writes into the caller's objects, on the first attempt or the 401 retry. Tests build a realRequestso header replacement is visible.