BLOCKER: DevSessionKey constant is wrong length (35 bytes, need 32) #19
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/webhooker#19
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
The
DevSessionKeyconstant ininternal/config/config.godecodes to 35 bytes, butinternal/session/session.gorequires exactly 32 bytes. This makes the default dev key unusable.Details
In
config.go:The string
"webhooker-dev-session-key-insecure!"is 35 characters, so base64-decoding produces 35 bytes.In
session.go:Impact
If a user follows the pattern of setting
SESSION_KEYto theDevSessionKeyvalue (as the config test YAML does), the app crashes at startup withSESSION_KEY must be 32 bytes (got 35).The config test (
TestSessionKeyDefaults) passes because it only tests the config layer, never instantiating the session. This is an integration testing gap.Running in dev mode without explicitly providing a valid 32-byte SESSION_KEY env var requires the user to generate their own key, which defeats the purpose of having a dev default.
Fix
head -c 32 /dev/urandom | base64DevSessionKeyconstant to use this valueReproduction