Skip to content

Hotfix: Login / Auth on Private IP#839

Merged
Wikid82 merged 3 commits intodevelopmentfrom
hotfix/login
Mar 15, 2026
Merged

Hotfix: Login / Auth on Private IP#839
Wikid82 merged 3 commits intodevelopmentfrom
hotfix/login

Conversation

@Wikid82
Copy link
Owner

@Wikid82 Wikid82 commented Mar 15, 2026

No description provided.

…rivate network HTTP connections

- Expanded fetchSessionUser to include Bearer token from localStorage as a fallback for authentication when Secure cookies fail.
- Updated headers to conditionally include Authorization if a token is present.
- Ensured compatibility with the recent fix for the Secure cookie flag on private network connections.
@Wikid82 Wikid82 marked this pull request as ready for review March 15, 2026 02:32
Copilot AI review requested due to automatic review settings March 15, 2026 02:32
@github-advanced-security
Copy link

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a login failure when Charon is accessed over plain HTTP via a private-network IP by (1) ensuring the backend does not set Secure=true cookies for local/private HTTP requests and (2) adding a frontend Bearer-token fallback for session validation.

Changes:

  • Expand backend “local request” host detection to treat RFC1918/IPv6 ULA IPs as local, so HTTP logins from private IPs can receive usable (non-Secure) auth cookies.
  • Add Authorization: Bearer <token> fallback to fetchSessionUser() so /api/v1/auth/me can succeed even if cookies are not available/accepted.
  • Add/extend backend tests and add QA/spec/manual test documentation for issue #825.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
frontend/src/context/AuthContext.tsx Adds Bearer token header fallback for /api/v1/auth/me session validation.
backend/internal/api/handlers/auth_handler.go Treats private IPs as “local” for cookie security decisions; updates related comments.
backend/internal/api/handlers/auth_handler_test.go Adds test coverage for private IP + IPv6 ULA cookie behavior and host helper assertions.
docs/reports/qa_report_issue_825.md QA audit report for issue #825 and validation steps/results.
docs/plans/telegram_remediation_spec.md Adds a Telegram test remediation plan document (unrelated to auth hotfix functionality, but included in PR).
docs/plans/current_spec.md Replaces current plan with issue #825 investigation/spec writeup.
docs/issues/issue-825-manual-test-plan.md Adds a manual test plan for validating HTTP login on private-network IPs.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 15, 2026

⚠️ Supply Chain Verification Results

⚠️ WARNING

📦 SBOM Summary

  • Components: 1672

🔍 Vulnerability Scan

Severity Count
🔴 Critical 0
🟠 High 3
🟡 Medium 18
🟢 Low 3
Total 24

📎 Artifacts

  • SBOM (CycloneDX JSON) and Grype results available in workflow artifacts

Generated by Supply Chain Verification workflow • View Details

@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Wikid82 Wikid82 merged commit 0e55643 into development Mar 15, 2026
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants