Tony/701_web_security_key - #48
Closed
tonypioneer wants to merge 2 commits into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a web security issue where Solid-OIDC session secrets (notably the DPoP private key) could be retrieved from browser localStorage by switching web storage to an in-memory OIDC store and adding a best-effort cleanup of legacy persisted values.
Changes:
- Replaced
OidcDefaultStore()with a platform-aware store (createSolidAuthStore()), using in-memory storage on web. - Added
purgeLegacyWebSecrets()to remove previously persisted session parameters from web persistent storage. - Updated session-store wiring to use the same platform-aware storage selection.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/auth/solid_oidc_manager_factory.dart | Switches OIDC manager store to platform-aware storage (web in-memory). |
| lib/src/auth/solid_auth_store.dart | Introduces platform-aware OIDC store selection and legacy web secret purge helper. |
| lib/src/auth/solid_auth_session_store.dart | Uses platform-aware store for session params (web in-memory). |
| lib/src/auth/solid_auth_manager.dart | Calls legacy secret purge during login flow. |
| example/.metadata | Updates Flutter project metadata (tooling revision/platform migration entries). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+90
to
+93
| await persistent.removeMany( | ||
| OidcStoreNamespace.secureTokens, | ||
| keys: _legacyWebSessionKeys, | ||
| ); |
Comment on lines
+174
to
+177
| // On web, remove any DPoP private key / session parameters a previous | ||
| // persistent build may have left in localStorage. No-op on native. | ||
|
|
||
| await purgeLegacyWebSecrets(); |
Comment on lines
+89
to
+91
| // Platform-aware store: persistent (OS-backed) on native, in-memory on web | ||
| // so the DPoP private key is never written to localStorage (see | ||
| // [createSolidAuthStore]). |
Comment on lines
+33
to
34
| import 'package:solid_auth/src/auth/solid_auth_store.dart'; | ||
| import 'package:solid_auth/src/auth/solid_oidc_config.dart'; |
13 tasks
Collaborator
Author
|
Close this PR for now, and will submit a new PR after fixing this issue by using sessionStorage to save the security key for the web app. |
13 tasks
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.
Pull Request Details
Description
Fixed the issue that the security key can be retrieved from web localStorage.
Related Issues
anusii/solidpod#701
Type of Change
How To Test?
Run the app on web browser, and follow the instructions in anusii/solidpod#701
Checklist
make preporflutter analyze lib)dart testoutput or screenshot included in issue #Finalising