CVE-2024-25718
📋 TL;DR
This vulnerability in the Samly package for Elixir allows expired authentication sessions to remain valid, potentially enabling unauthorized access to protected resources. It affects applications using Samly for SAML-based authentication before version 1.4.0. Attackers could exploit this to bypass access controls and gain privileges they shouldn't have.
💻 Affected Systems
- Samly package for Elixir
📦 What is this software?
Samly by Dropbox
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise where attackers gain administrative access to all protected resources, potentially leading to data theft, privilege escalation, and full control over affected applications.
Likely Case
Unauthorized access to protected resources and data, allowing attackers to impersonate legitimate users and bypass authentication mechanisms.
If Mitigated
Limited impact with proper session management controls and monitoring, though authentication bypass remains possible.
🎯 Exploit Status
Exploitation requires access to expired session data but is straightforward once obtained.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.4.0
Vendor Advisory: https://github.com/dropbox/samly/pull/13
Restart Required: Yes
Instructions:
1. Update mix.exs to require samly ~> 1.4.0
2. Run 'mix deps.update samly'
3. Recompile and restart your application
4. Verify session expiration is now properly enforced
🔧 Temporary Workarounds
Manual session validation
allImplement custom session validation to check expiration timestamps before accepting sessions
Implement custom AuthHandler with explicit session expiration checks
🧯 If You Can't Patch
- Implement additional authentication layers or multi-factor authentication
- Reduce session lifetimes and implement aggressive session cleanup
🔍 How to Verify
Check if Vulnerable:
Check your mix.lock or mix.exs for samly version < 1.4.0
Check Version:
mix deps | grep samly
Verify Fix Applied:
Test that expired sessions are properly rejected and new sessions are required after expiration
📡 Detection & Monitoring
Log Indicators:
- Multiple authentication attempts with same session ID after expiration
- Session validation failures
Network Indicators:
- Unusual authentication patterns
- Session reuse after expected expiration
SIEM Query:
source="application_logs" AND (session_expired OR auth_bypass OR invalid_session)
🔗 References
- https://diff.hex.pm/diff/samly/1.3.0..1.4.0
- https://github.com/dropbox/samly
- https://github.com/dropbox/samly/pull/13
- https://github.com/dropbox/samly/pull/13/commits/812b5c3ad076dc9c9334c1a560c8e6470607d1eb
- https://github.com/handnot2/samly
- https://hex.pm/packages/samly
- https://diff.hex.pm/diff/samly/1.3.0..1.4.0
- https://github.com/dropbox/samly
- https://github.com/dropbox/samly/pull/13
- https://github.com/dropbox/samly/pull/13/commits/812b5c3ad076dc9c9334c1a560c8e6470607d1eb
- https://github.com/handnot2/samly
- https://hex.pm/packages/samly