Without Secure: true, the session cookie will be sent over plaintext HTTP connections, making it vulnerable to interception by network attackers (e.g., on shared Wi-Fi).
Suggested Fix
Add Secure: true to the cookie options, or make it configurable based on whether the app is behind TLS:
## Bug
**File:** `internal/service/auth/auth.go`, `New()`, line ~70
**Severity:** MEDIUM — Session hijacking
### Description
The session cookie store is configured without the `Secure` flag:
```go
store.Options = &sessions.Options{
Path: "/",
MaxAge: sessionMaxAgeSeconds,
HttpOnly: true,
SameSite: http.SameSiteLaxMode,
}
```
Without `Secure: true`, the session cookie will be sent over plaintext HTTP connections, making it vulnerable to interception by network attackers (e.g., on shared Wi-Fi).
### Suggested Fix
Add `Secure: true` to the cookie options, or make it configurable based on whether the app is behind TLS:
```go
store.Options = &sessions.Options{
Path: "/",
MaxAge: sessionMaxAgeSeconds,
HttpOnly: true,
Secure: true,
SameSite: http.SameSiteLaxMode,
}
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bug
File:
internal/service/auth/auth.go,New(), line ~70Severity: MEDIUM — Session hijacking
Description
The session cookie store is configured without the
Secureflag:Without
Secure: true, the session cookie will be sent over plaintext HTTP connections, making it vulnerable to interception by network attackers (e.g., on shared Wi-Fi).Suggested Fix
Add
Secure: trueto the cookie options, or make it configurable based on whether the app is behind TLS:fixed in #10