Skip to content

fix(security): salvage #30553 + #11004 OAuth file-safety hardening - #31747

Merged
teknium1 merged 3 commits into
mainfrom
hermes/hermes-f9dd4507
May 25, 2026
Merged

fix(security): salvage #30553 + #11004 OAuth file-safety hardening#31747
teknium1 merged 3 commits into
mainfrom
hermes/hermes-f9dd4507

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of two stale OAuth-related PRs that conflicted with the just-merged batch (#27217, #30972, #21152).

Commits (rebased onto current main, contributor authorship preserved)

Test plan

pytest tests/tools/test_file_operations.py             # 77 passed
pytest tests/hermes_cli/test_web_server_oauth_write.py # 2 passed

Co-authored-by: kronexoi kronexoi13@gmail.com
Co-authored-by: shaun0927 70629228+shaun0927@users.noreply.github.com

Closes #30553
Closes #11004

kronexoi and others added 3 commits May 24, 2026 17:46
…ees as other auth paths

The web dashboard's Anthropic OAuth helper wrote the credential file
straight to its final destination and relied on the process umask for
permissions. That left the dashboard-specific path weaker than the
existing auth writers, which already use owner-only permissions and
safer write semantics.

This change keeps the scope narrow: make the dashboard helper write via
a temp file + replace, chmod the final file to owner-only, and add a
focused regression test for both permission handling and atomic-write
behavior.

Constraint: Must preserve the existing dashboard OAuth flow and credential-pool side effects
Rejected: Broader auth-storage refactor | unnecessary scope for a single verified inconsistency
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep dashboard credential writes aligned with existing auth storage semantics; do not reintroduce direct write_text() here without matching chmod/atomic behavior
Tested: pytest -o addopts='' tests/hermes_cli/test_web_server_oauth_write.py tests/hermes_cli/test_web_server.py -q (78 passed)
Not-tested: Cross-platform permission semantics on Windows-managed filesystems
@teknium1
teknium1 merged commit 243ebc7 into main May 25, 2026
22 checks passed
@teknium1
teknium1 deleted the hermes/hermes-f9dd4507 branch May 25, 2026 00:47
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-f9dd4507 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9104 on HEAD, 9103 on base (🆕 +1)

🆕 New issues (1):

Rule Count
unresolved-import 1
First entries
tests/hermes_cli/test_web_server_oauth_write.py:3: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`

✅ Fixed issues: none

Unchanged: 4850 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/security Security vulnerability or hardening comp/cli CLI entry point, hermes_cli/, setup wizard area/auth Authentication, OAuth, credential pools P1 High — major feature broken, no workaround labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/cli CLI entry point, hermes_cli/, setup wizard P1 High — major feature broken, no workaround type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants