Commit ec7d0dd
authored
fix(security): correct CSRF token expiration from nanoseconds to 1 hour (#390)
## Summary
- **Critical security fix**: CSRF token expiration was incorrectly set
to `3600` (interpreted as 3600 nanoseconds = ~3.6 microseconds) instead
of `time.Hour`
- This caused all login attempts to fail with "CSRF token validation
failed" because tokens expired instantly
- Production at https://accessmanager.netresearch.de/login is affected
## Root Cause
```go
// Before (broken) - 3600 nanoseconds = instant expiration
Expiration: 3600, // 1 hour
// After (fixed) - proper 1 hour duration
Expiration: time.Hour,
```
The Fiber CSRF middleware expects a `time.Duration`, but was given an
untyped integer which Go interpreted as nanoseconds.
## Test plan
- [x] Built and tested locally with docker compose
- [x] Verified CSRF tokens are now properly validated
- [x] Ran CSRF-related tests (`go test ./internal/web/... -run CSRF`)1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
0 commit comments