# GHSA-5j35-xr4g-vwf4: @grackle-ai/server has a Missing Secure Flag on Session Cookie

- Severity: Low (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:A/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-03-25T17:32:39.000Z
- Modified: 2026-03-25T17:46:26.843Z
- Weaknesses: CWE-614

## Description

### Impact

The session cookie is set with `HttpOnly; SameSite=Lax; Path=/` but does not include the `Secure` flag. This means the cookie will be sent over plain HTTP connections.

Since the server binds to `127.0.0.1` by default and uses HTTP (not HTTPS), this is acceptable for localhost use. However, when `--allow-network` is used to bind to `0.0.0.0`, cookies could be transmitted over insecure network connections and intercepted by an attacker.

**Affected code:**
- `packages/server/src/session.ts:76` — cookie string lacks `; Secure` attribute

### Patches

0.70.5

**Fix:** Conditionally add `; Secure` when served over HTTPS or when `--allow-network` is enabled:
```typescript
const securePart = isHttps ? "; Secure" : "";
return `${SESSION_COOKIE_NAME}=${cookieValue}; HttpOnly; SameSite=Lax; Path=/${securePart}; Max-Age=${maxAge}`;
```

### Workarounds

Do not use `--allow-network` over untrusted networks without a TLS-terminating reverse proxy.

### Resources

- OWASP: Secure Cookie Attribute
- File: `packages/server/src/session.ts`

(As written by GitHub Advisory Database.)

## Affected

- @grackle-ai/server (npm): before 0.70.5

## References

- <https://github.com/nick-pape/grackle/security/advisories/GHSA-5j35-xr4g-vwf4> (web)
- <https://github.com/nick-pape/grackle> (package)

## Sources

- GitHub Advisory Database: [GHSA-5j35-xr4g-vwf4](https://github.com/advisories/GHSA-5j35-xr4g-vwf4), CC-BY-4.0, modified 2026-03-25

---

Page: https://cve.day/GHSA-5j35-xr4g-vwf4 · Whole record: https://cve.day/GHSA-5j35-xr4g-vwf4.json · Rebuilt by cve.day 2026-11-25T22:56:44.203Z
