-
Notifications
You must be signed in to change notification settings - Fork 11
Deep audit hardening: security remediations + auth/rotation reliability fixes #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
af78211
fix(security): remediate audited dependency vulnerabilities
ndycode c04782d
fix(auth): harden loopback redirect and token-aware account selection
ndycode 618f06b
docs(audit): publish deep architecture security audit notes
ndycode 5d0135c
fix(oauth): harden callback server startup fallback path
ndycode 276056f
fix(oauth): enforce callback state in waitForCode polling
ndycode c24bfae
test(types): remove legacy ts-ignore suppressions in storage suite
ndycode 7c911b6
fix(auth): align waitForCode expectedState parameter naming
ndycode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Architecture + Security Audit (2026-02-28) | ||
|
|
||
| ## Scope | ||
|
|
||
| - Full repository audit across auth, request pipeline, account rotation, storage, and dependency supply chain. | ||
| - Severity focus: Critical, High, Medium. | ||
| - Remediation PR policy: fix-in-place for findings above threshold. | ||
|
|
||
| ## Findings and Remediations | ||
|
|
||
| ### 1) Dependency Vulnerabilities (High/Moderate) | ||
|
|
||
| - Baseline `npm audit` reported 4 vulnerabilities (3 high, 1 moderate), including direct `hono` exposure plus transitive `rollup`, `minimatch`, and `ajv`. | ||
| - Remediation: ran `npm audit fix`, updated lockfile graph, and verified `npm audit` reports zero vulnerabilities. | ||
|
|
||
| ### 2) OAuth Loopback Host Mismatch (Medium) | ||
|
|
||
| - OAuth redirect URI used `localhost` while callback listener binds to `127.0.0.1`. | ||
| - On environments where `localhost` resolves to non-IPv4 loopback, this can cause callback failures. | ||
| - Remediation: aligned redirect URI to `http://127.0.0.1:1455/auth/callback`. | ||
|
|
||
| ### 3) Hybrid Selection vs Token-Bucket Eligibility Mismatch (Medium) | ||
|
|
||
| - Hybrid account selection and current-account fast path did not enforce token availability. | ||
| - This could pick accounts that are locally token-depleted and trigger avoidable request failure behavior. | ||
| - Remediation: | ||
| - enforce token availability during current-account reuse and hybrid eligibility filtering; | ||
| - continue account traversal when local token consumption fails to avoid premature loop exit. | ||
|
|
||
| ### 4) OAuth Success-Page Single-Point Failure (Medium) | ||
|
|
||
| - OAuth callback server loaded `oauth-success.html` synchronously at module import with no fallback. | ||
| - If that asset was missing in a runtime package edge case, plugin startup could fail before auth flow execution. | ||
| - Remediation: | ||
| - add resilient loader with warning telemetry; | ||
| - serve a built-in minimal success page when file load fails. | ||
| - enforce `waitForCode(state)` contract by checking captured callback state before returning a code. | ||
|
|
||
| ## Verification | ||
|
|
||
| - `npm run lint` pass | ||
| - `npm run typecheck` pass | ||
| - `npm test` pass | ||
| - `npm audit` reports zero vulnerabilities | ||
|
|
||
| ## Notes | ||
|
|
||
| - This audit focused on root-cause correctness and supply-chain risk reduction, while preserving existing plugin APIs and storage format compatibility. |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.