Stolen Tokens and Document Access After Sign-In

Validate the credential, authorise each request, and measure containment

Published Updated

Stolen Tokens and Document Access After Sign-In. Teal glass illustrations of a verified identity card, a document behind a gate, and a clock with a locked access switch, labelled Validate, Authorise, and Contain, on navy with the FormKiQ wordmark.

Protect document access throughout the session. Multi-factor authentication (MFA) strengthens sign-in, while a later API request may use a token issued after that sign-in. If an attacker obtains a usable bearer token, possession can be enough to make requests within its remaining authority and lifetime.

The practical design has three parts: accept only the intended tokens, apply the permissions for each document operation, and know how quickly access stops during an incident. Ending a browser session, revoking refresh capability, denying an API request, and stopping an issued download link involve different controls.

The final September 2026 NIST IR 8587 addresses token and assertion protection for federal agencies and cloud service providers. Its recommendations cover signing keys, verification, lifecycle controls, and monitoring. Use those themes to review the credentials, permissions, and response actions in a document-access workflow.

Know which credential each request uses

Single sign-on (SSO) lets an application rely on an identity provider for authentication. A JSON Web Token (JWT) carries claims such as its issuer, intended audience, subject, and expiry, protected by the token's cryptographic format. Different tokens and sessions serve different purposes.

A credential inventory for the access path and incident runbook.
Credential or sessionWhat the team should identify
Identity-provider or application sessionWhich service maintains the session, which logout action affects it, and whether other sessions remain active.
ID tokenThe client's authentication result. Keep the API's accepted token purpose explicit so a suitable-looking ID token is not accidentally accepted as an API access credential.
Access tokenThe API audience, allowed scopes or claims, expiry, and the checks actually enforced on each request.
Refresh tokenThe authority to obtain new tokens and the provider-specific action that revokes that capability.
Workload credentialThe integration's identity and permissions. A user's logout does not define the lifecycle of an independent IAM role or API key.
Presigned download URLThe file grant's own expiry, signing credentials, and storage controls, separately from the application session.

Keep verification, authorisation, and containment distinct

  1. 1 · Validate

    Accept the intended token

    Use the expected issuer, key, algorithm, audience, token purpose, and validity window.

  2. 2 · Authorise

    Decide this operation

    Apply the configured site, role, resource, and action rules to the actual request.

  3. 3 · Contain

    Measure when access ends

    Exercise provider revocation, application controls, caches, and issued file grants as separate parts of the response.

Verify the token's intended use

Use trusted issuer configuration and an explicit algorithm policy before accepting claims. Check the expected recipient, time bounds, and token purpose. A token's own header should not select an arbitrary trusted key or validation rule. JWT Best Current Practices, RFC 8725, explains algorithm verification, audience checks, and mutually exclusive validation rules for different token types.

For HTTP APIs using the API Gateway JWT authoriser, AWS recommends scopes or appropriately distinct issuer/audience settings to distinguish access tokens from other JWTs. Its public-key cache can retain keys for up to two hours. Plan routine key rollover with the documented overlap, and design the compromised-key response around the actual caches and enforcement points. A custom authoriser has its own configuration and behaviour.

Signing-key compromise and theft of one user's token call for different investigations. Establish which material was exposed and which identities or clients could be affected. Keep issuer signing-key response separate from document-encryption-key operations, and test how each relevant verifier responds to the approved containment action.

Measure revocation at the API boundary

An issuer can record revocation while a separate verifier still accepts a self-contained token's signature and expiry. Amazon Cognito documents this distinction: its revocation state governs token use with Cognito, while a JWT library checking signature and expiration can continue to consider the revoked token valid.

Define the end-to-end response for the deployed access path. It can combine revoking refresh capability, ending the relevant provider and application sessions, applying a request-time containment rule, and waiting for bounded token or cache expiry. Measure the first rejected request using the affected credential. Record any remaining window and the control responsible for it.

A role or group claim reflects what the issuer placed in that token. If the request needs current account, assignment, or document state, identify the configured source and enforcement point for that decision. The attribute-based document-authorisation guide covers that resource-policy side of the design.

Include file delivery in the containment plan

After the application issues a presigned S3 URL, the file request follows that grant's storage-access rules. Signing out of the application does not directly end the S3 grant. AWS describes its separate expiration and credential controls. Use short, purpose-appropriate grants and test the intended revocation path.

Include previews, original downloads, bulk exports, and queued jobs in the inventory. Recheck the required authority at sensitive execution or release points. A copy already downloaded remains a separate incident-response consideration. The presigned document URL guide examines that delivery window in more detail.

Worked example: contain a copied browser credential

This fictional response exercise uses an access token expiring at 09:15 and a download grant issued at 09:03 for five minutes. These are chosen test values, not FormKiQ defaults or recommended universal lifetimes. Endpoint monitoring reports that a browser credential may have been copied; the team investigates its use without treating an IP-location anomaly alone as proof.

  1. 1. Establish the affected access path

    The team identifies the issuer, client, user reference, relevant session, token validity window, and document requests. It records that reference information in incident INC-00041 without copying the bearer token into the case notes.

  2. 2. Stop new authority and contain current requests

    At 09:04, the responder disables the affected account or session through the approved provider action and revokes the relevant refresh capability. The configured application/API containment control is applied too. The exercise records each result separately.

  3. 3. Test the existing credential

    Using a controlled test copy, the team checks a new document API request and records when it is denied. If signature-only validation still accepts the token, the incident remains open for that path; the provider's successful revocation response is not recorded as proof that API access ended.

  4. 4. Check the earlier download grant

    A URL issued at 09:03 may remain usable during its own validity window, subject to its signing credentials and storage policies. The team tests the approved containment action and records the actual outcome. It separately identifies any content already delivered.

  5. 5. Confirm recovery and preserve the decision

    The owner checks affected documents, permissions, application sessions, and integration credentials. Reopening access follows the incident decision and tested controls. The evidence file connects the response actions to observed denial, remaining exposure, corrective work, and closure review.

Give workloads their own identities

A background importer or ERP connector should have an identity, owner, permission scope, and recovery procedure suited to its work. FormKiQ's documented IAM API supports signed machine-to-machine requests, typically as service-level or administrative integrations. Treat that authority separately from interactive user-group permissions. Where appropriate, use short-lived AWS role credentials for that route. Manage API keys through their separate lifecycle and keep browser tokens out of scheduled integrations.

Use the document-API test plan to exercise each caller and enforcement boundary, including exceptional responses and access changes during an export.

Test containment for one workload without assuming it shares a user's sign-in session. The delegated-action audit guide explains how to retain the initiating person, approved authority, and executing service as distinct evidence.

A practical access-containment checklist

  • Reject the wrong issuer, audience, algorithm, token purpose, or time window at the intended API route.
  • Distinguish routine signing-key rollover from a compromised-key response, including verifier caches.
  • Measure when an existing credential stops working after the approved containment action.
  • Test resource access after a relevant account, role, or document-policy change.
  • Check previously issued download grants and content already released.
  • Exercise queued work and one independent integration identity.
  • Retain request outcomes and response evidence without logging bearer tokens, cookies, or signed URLs.

Show where access is enforced and when it ends

Strong sign-in and a controlled session work together. Verify the credential presented to each service, apply the permissions for the requested document action, and measure containment across API and delivery paths. A useful response record explains the observed outcome for each path and the work needed before access is restored.

      Start with FormKiQ Core

      The open-source foundation — API-first, deployable into your own AWS account, and free to use. Right for architecture validation and early implementation.

      Get Started Free

      Deploy FormKiQ Essentials or Advanced

      Production-ready editions for departments and complex workflows. Start with a Proof-of-Value deployment or go straight to production.

      Explore Options

      Plan an Enterprise Rollout

      For governance-heavy environments with residency, sovereignty, assurance, and multi-jurisdiction requirements. Talk to us about the right deployment model.

      Book a Call