Repository navigation
Security hardening: credentials on the server's origin, PBKDF2 PIN, lost-PIN recovery - #62
Merged
Merged
Conversation
Credentials stay on the server's origin: - AuthHeaders.forUrl gives the API key / session cookie only for URLs on the configured scheme, host and port (images, sprites, streams, previews, lock screen art, iOS PiP, cast ?apikey=). - OriginGuardClient follows redirects itself and drops ApiKey, Cookie and Authorization once a redirect leaves the origin (GraphQL, server files, and the image cache via stashImageCacheManager). - StashSessionClient adds the cookie only on the origin. - MediaOriginBanner warns when the server hands out media URLs on another origin (proxy without Host / X-Forwarded-Proto), naming both addresses. App lock and PIN: - PINs are stored as PBKDF2-HMAC-SHA256 (StoredPin). Legacy salted SHA-256 values are still accepted and upgraded after the next correct PIN, so existing users keep their PIN. - An enabled lock whose PIN can't be read (unreadable or emptied secure storage) stays locked: PinLostView offers biometrics followed by a new PIN, or resetting the app. Other fixes: - User info in a server URL (user:password@) is kept in the secret store (url_auth:<id>) instead of the profile JSON; stored profiles migrate on start, and the UI shows the URL without it. - GraphQL uses noCache: networkOnly kept filling a normalized cache that was never read. - The preview check cancels the body after the status instead of downloading whole files when a server ignores Range. - The password login times out after 20 s and reads only the headers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With biometric unlock on, confirmPin also accepts Face ID or the fingerprint: a button on the PIN pad, or asked right away while wrong PINs block the pad. Success resets the PIN throttle. Before, a forgotten PIN could only be replaced by clearing the app's data, even though the app could still be unlocked with biometrics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entry 3 (entry 2 shipped with v1.0.0-beta.8) announces the changes from PR #61 and this branch: lists keep their place through fullscreen, the favorites selector, zoom snap feedback, biometrics for the PIN and the proxy warning; the PIN hash, lost-PIN recovery, URL passwords in the secure storage and fewer requests are behind "Show more". The release notes draft now describes the next beta. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 3 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
StatusBanner holds the layout ConnectionBanner and MediaOriginBanner both copied, and the two confirmPin widget tests pump the same page through pumpConfirm (Codacy's duplication report on PR #62). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Credentials stay on the server's origin
AuthHeaders.forUrlgives the API key / session cookie only for URLs on the configured scheme, host and port: images, sprites, streams, previews, lock screen art, iOS PiP and the cast?apikey=.OriginGuardClientfollows redirects itself and dropsApiKey,CookieandAuthorizationonce a redirect leaves the origin (dart:ioforwards custom headers). It is used by GraphQL, server files and the image cache (stashImageCacheManager).MediaOriginBannerwarns when the server hands out media URLs on another origin (reverse proxy withoutHost/X-Forwarded-Proto), names both addresses and says how to fix it. It can be hidden per server.App lock and PIN
PinLostViewoffers biometrics followed by a new PIN, or "Reset app".Other
user:pass@) moves from the profile JSON to the secret store (url_auth:<id>); existing profiles migrate on start, and the UI shows the URL without it.noCache:networkOnlykept filling a normalized cache that was never read.Testing
dart analyzeclean,flutter test944 passing (new: origin guard, session origin and timeout, PIN hash, migration, lost PIN, biometric confirm, URL password migration, empty GraphQL cache, preview check, media origin check and banner).🤖 Generated with Claude Code