Skip to content

security: pk_/sk_ key rotation, origin-validation hardening, and CSP guidance for embedded widget #36

Description

@aguilar1x

Context

The publishable/secret key model (#11) and origin validation shipped in the first campaign but have no rotation story and no documented Content-Security-Policy guidance for merchants embedding the widget — both of which a real security review will flag before production use.

Scope

  • Key rotation flow: issue a new sk_/pk_ pair without invalidating the old one until the merchant confirms cutover (grace period).
  • Harden origin validation to cover wildcard/subdomain edge cases and reject malformed Origin/Referer headers explicitly.
  • Publish CSP + iframe-sandboxing guidance for merchants embedding connect-elements, and add automated tests asserting the shipped widget respects those constraints.

Acceptance criteria

  • Rotating a key does not break in-flight sessions using the old key during the grace period.
  • A request with a spoofed or malformed origin is rejected with a clear error code, with a test covering the edge cases.
  • Docs site includes a CSP snippet merchants can copy-paste, verified against the actual widget bundle.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26area:gatewayConnect Gateway (BFF)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions