Security model
GiState is built with security as a primary design constraint, not an afterthought.
Authentication
- API keys are 32-byte random tokens, prefixed
GS_, stored as SHA-256 hashes - Raw keys are shown exactly once at creation, GiState cannot recover a lost key
- Session cookies are httpOnly, Secure, SameSite=Lax
- Passwords hashed with Argon2id (OWASP 2024 parameters: 19456 KB memory, 2 iterations, 1 lane)
Organizations: sign-in and provisioning
- Email domains are verified with a DNS TXT record. One organization at most holds a domain, and single sign-on and SCIM act only on addresses at its verified domains
- OpenID Connect: the authorization code flow with PKCE (S256), state and nonce; ID tokens checked against the provider's published keys, RS, PS and ES algorithms only
- SAML 2.0: signed responses or assertions (RSA with SHA-256 or stronger), exclusive canonicalization, exactly one assertion, and audience, recipient, request and time all checked. No DOCTYPE or entities are parsed, and sign-in starts at GiState, never at the identity provider
- Each sign-in is good once, for ten minutes, in the browser that started it
- SCIM tokens are stored as SHA-256 hashes. When the identity provider deactivates someone, the sessions its single sign-on made for them end
- Owners can require single sign-on (keeping their own password as a way in) and two-factor for everyone
Concurrency & financial integrity
- Balance deductions use
pg_advisory_xact_lock(key_id_hash)serialized at the database - An optional account-wide spend ceiling over a rolling 6-hour window stops runaway agents
- Stripe webhook events are idempotent via unique
stripe_event_id+ 5-min timestamp tolerance - Merge operations are atomic with full rollback on any failure
Cryptographic posture
- Webhook signatures verified with
crypto.timingSafeEqual: no early-exit timing leaks - Admin tokens compared with constant-time HMAC
- Session tokens are 256 bits of entropy from
crypto.randomBytes
Network
- HTTPS only, with HSTS (includeSubDomains, max-age 31536000, preload) on the API
- X-Frame-Options DENY, X-Content-Type-Options nosniff and a strict referrer policy
- Per-IP limits on sign-in, sign-up and password reset
Data protection
- Every lookup is scoped to the account that owns the data
- Parameterised queries throughout; malformed identifiers are refused with 400
- An audit log records payments, balance changes and state status changes
Compliance
- California DROP Act: cryptographic erasure on account deletion; identity unlinkable from retained audit records
- EU AI Act Article 50: transparency disclosures in our Privacy Policy
- GDPR Article 17 (Right to erasure): supported via
DELETE /account - GDPR Article 20 (Data portability): supported by request
- CCPA: California users have full access, deletion, and opt-out rights
- Florida SB 482: age verification compliance for users in Florida
Incident response
Email security@gistate.com for responsible disclosure. We acknowledge within 24 hours and aim to remediate critical issues within 72 hours.
What we don't do
- We don't sell your data: ever
- We don't require KYC for basic API access
- We don't pre-bake backdoors for "law enforcement convenience"