Skip to content

Security: botiverse/raft-gmail

Security

SECURITY.md

Security

Reporting a vulnerability

Please do not open a public issue for a vulnerability that could expose Gmail content, OAuth tokens, Raft identity data, or cross-tenant access. Contact the Raft maintainers privately through the security contact listed on the repository.

Operator responsibilities

This is self-hosted software. The operator is responsible for:

  • protecting RAFT_CLIENT_SECRET, GOOGLE_CLIENT_SECRET, SESSION_SECRET, and TOKEN_ENCRYPTION_KEY_BASE64;
  • using HTTPS and secure cookies outside local development;
  • restricting database and backup access;
  • rotating secrets and deleting disconnected-account data;
  • reviewing Google OAuth verification and restricted-scope obligations for the deployment;
  • monitoring audit events without logging email bodies or tokens.

The 32-byte token-encryption key encrypts Google refresh tokens with AES-256-GCM. Losing it makes stored Gmail connections unusable; disclosing it exposes every stored refresh token to anyone who can also read the database. This initial version does not yet implement online key rotation.

Human owner mutations require both the signed same-site session cookie and its X-CSRF-Token challenge. Agent actions use an independent bearer session and do not accept the human cookie as authorization.

Service-local Agent sessions default to 15 minutes and cannot be configured beyond one hour. Account-grant revocation is checked live on every action. Raft app-install revocation is not yet pushed into this service, so a previously issued local Agent session remains structurally valid until its short expiry; deployments that need immediate app-level revocation should add a Raft revoke hook or live introspection before widening the session lifetime.

Send boundary

Google's gmail.compose scope permits both draft management and sending. The service's narrower guarantee comes from the public manifest and implementation, not from the Google scope: there is no immediate-send action, and exactly one provider draft-send call is owned by the scheduled worker. That worker atomically claims a due job, revalidates the live gmail.schedule grant, and never retries an ambiguous outcome. CI checks this source boundary, but review is still required when dependencies, action wiring, or Worker scheduling change.

Privacy

Owner APIs never return encrypted tokens. Agent action audit metadata and scheduled-job rows exclude subjects, bodies, recipients, raw MIME, and provider tokens. Scheduled content lives only in the Gmail draft. Search and read results do contain authorized mailbox data and are returned only to the calling Agent; downstream handling is outside this service's boundary.

There aren't any published security advisories