Skip to content

Security: Gate header-driven ACL configuration behind trust boundary #338

Description

@coderabbitai

Description

Header-driven ACL configuration introduced in PR #337 needs security enhancements to prevent privilege escalation attacks. Currently, any client can spoof 'Tinyauth-Apps-...' headers to bypass access controls.

Security Concerns

  • Clients can forge headers to escalate privileges
  • No validation of request source or authenticity
  • Feature enabled by default without safeguards

Required Security Measures

The DecodeHeaders(utils.NormalizeHeaders(...)) call in internal/controller/proxy_controller.go (around line 73) must be protected by:

  1. Source IP Allowlist: Verify requests originate from trusted reverse proxies
  2. HMAC Signature Validation: Validate X-Tinyauth-Signature header using shared secret
  3. Feature Flag: Disable header-driven ACLs by default, require explicit enablement

Implementation Requirements

  • Add configuration for trusted proxy IP allowlist
  • Implement HMAC signature validation for headers
  • Add feature flag to enable/disable header-driven ACLs (default: disabled)
  • Update documentation with security considerations
  • Provide sample reverse proxy configuration showing:
    • Trusted proxy IP setup
    • HMAC signature computation and transmission

References

Metadata

Metadata

Assignees

Labels

pinnedThis issue is pinned

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions