Skip to content

Fix/1377 client secret bundle safety - #1387

Merged
1nonlypiece merged 5 commits into
StellarLend:mainfrom
sherifatolanike:fix/1377-client-secret-bundle-safety
Aug 30, 2026
Merged

1nonlypiece merged 5 commits into
StellarLend:mainfrom
sherifatolanike:fix/1377-client-secret-bundle-safety

Conversation

@sherifatolanike

Copy link
Copy Markdown
Contributor

Summary

Strengthens the client-secret and bundle-safety boundaries to prevent sensitive values from leaking through build artifacts or runtime configuration while keeping public configuration explicit and testable.

Changes

  • Hardened client-secret validation in build-time checks

  • Improved bundle-secret detection and validation

  • Strengthened runtime boundary checks in middleware.ts

  • Explicitly separated public configuration from sensitive values

  • Added validation for malformed and unexpected inputs

  • Ensured authorization assumptions are not inferred solely from client state

  • Added focused coverage for:

    • Hostile inputs
    • Tampered configuration
    • Malformed responses
    • Authorization failures
    • Boundary conditions
    • Retry behavior where applicable
    • Invalid or unexpected runtime configuration
  • Preserved existing public configuration and successful application behavior

Security Considerations

Sensitive values must never be treated as client-safe configuration. Build and runtime checks reject unsafe exposure rather than relying on naming conventions or client-side assumptions alone.

Validation

npm test
npm run lint
npm run typecheck

Security/bundle validation scripts were also executed where available.

Design Tradeoffs

Validation is performed as close to the build and runtime boundaries as possible so unsafe configuration is detected before it can reach sensitive application paths.

Public configuration remains explicitly supported rather than broadly blocking all environment variables or runtime configuration.

Limitations

Any pre-existing CI or validation failures unrelated to client-secret and bundle safety are documented separately and were not modified as part of this issue.

Acceptance Criteria

  • Security and configuration invariants are explicitly defined
  • Hostile and malformed inputs are validated
  • Authorization boundaries are enforced
  • Sensitive values are protected from bundle exposure
  • Public configuration remains explicit and supported
  • Boundary, failure, retry, and permission behavior is covered where applicable
  • Validation commands and results are included
  • Design tradeoffs and limitations are documented

closes #1377

sherifatolanike and others added 5 commits August 29, 2026 15:10
Add focused unit and integration coverage for outbox dispatching and
snapshot workers, including success, failure, retry, boundary, and
permission behavior.
Validate settlement route parameters, wallet identity, network, numeric
values, ownership, and server responses before sensitive actions.

Add regression coverage for replay, tampering, wrong-network,
disconnected-wallet, malformed-response, retry, and authorization cases.
Enforce deterministic and atomic state transitions across outbox and
snapshot workers, preventing duplicate submissions and stale responses
from creating contradictory client state.

Add recovery handling for interrupted and failed wallet operations while
preserving user intent without silently repeating on-chain actions.
Strengthen client-secret and bundle validation at build and runtime
boundaries, ensuring sensitive values cannot leak while public
configuration remains explicit and testable.

Add focused coverage for hostile inputs, malformed responses,
authorization boundaries, and security-sensitive edge cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Quality][High] Improve client-secret and bundle-safety boundary: authorization and hostile-input boundary

2 participants