Skip to content

fix: batch 6 hardening for oauth secrets, masking, auth timing, and outbound URL validation (h-batch-6)#3115

Merged
crivetimihai merged 7 commits intomainfrom
h-batch-6
Feb 23, 2026
Merged

fix: batch 6 hardening for oauth secrets, masking, auth timing, and outbound URL validation (h-batch-6)#3115
crivetimihai merged 7 commits intomainfrom
h-batch-6

Conversation

@crivetimihai
Copy link
Copy Markdown
Member

Summary

This PR completes Batch 6 hardening and aligns behavior across /admin, /gateways, /servers, /a2a-agents, and /llmchat.

  • A-02: Centralized OAuth secret-at-rest protection for gateway/server/A2A persistence, including DCR credential writes, plus backfill migration for existing plaintext rows.
  • A-05: Added server OAuth masking parity on read/list responses, including cache reconstruction paths.
  • A-06: Hardened failed-auth timing paths with dummy verify + minimum response-time floor for uniform failure behavior.
  • O-10: Enforced encrypted-at-rest handling for A2A OAuth config with masking consistency across service and cached reads.
  • O-17: Enforced encrypted-at-rest handling for server OAuth config with backward-compatible/no-double-encrypt behavior.
  • S-02: Added SSRF-safe URL validation in /admin/gateways/test before outbound requests, with generic user-facing failures.
  • S-03: Added SSRF-safe URL validation in /llmchat/connect before session setup, with generic user-facing failures.

Additional updates:

  • Refactored OAuth runtime decrypt usage to shared helper paths (strict runtime use-sites only).
  • Updated docs/config schema and RC2 changelog entries to reflect the hardening behavior.

Refs: A-02, A-05, O-10, O-17

- centralize oauth secret protection for service-layer CRUD

- add server oauth masking parity for read/list responses

- keep oauth secret decrypt to runtime token exchange paths

- expand regression coverage for encryption and masking behavior

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Refs: A-06

- add dummy password verification on early login failures

- enforce configurable minimum failed-login response duration

- add focused regression tests for timing guard paths

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Refs: S-02, S-03

- validate admin gateway test base URL before outbound requests

- validate llmchat connect server URL before session setup

- add regression tests for strict local/private URL rejection

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Refs: A-02, A-05, A-06, O-10, O-17

- add branch-focused regression tests for oauth secret handling and runtime decrypt guards

- add legacy update-object coverage for server oauth update path

- align helper docstrings with linting policy requirements

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
…alidation (A-02 A-05 A-06 O-10 O-17 S-02 S-03)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai changed the title fix: batch 6 hardening for oauth secrets, masking, auth timing, and outbound URL validation fix: batch 6 hardening for oauth secrets, masking, auth timing, and outbound URL validation (h-batch-6) Feb 23, 2026
@crivetimihai crivetimihai self-assigned this Feb 23, 2026
@crivetimihai crivetimihai added security Improves security revisit Revisit this PR at a later date to address further issues, or if problems arise. labels Feb 23, 2026
@crivetimihai crivetimihai added this to the Release 1.0.0-GA milestone Feb 23, 2026
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai merged commit 7cda2f0 into main Feb 23, 2026
55 checks passed
@crivetimihai crivetimihai deleted the h-batch-6 branch February 23, 2026 10:40
cafalchio pushed a commit to cafalchio/mcp-context-forge that referenced this pull request Feb 23, 2026
…utbound URL validation (h-batch-6) (IBM#3115)

* fix: oauth config hardening and behavior consistency

Refs: A-02, A-05, O-10, O-17

- centralize oauth secret protection for service-layer CRUD

- add server oauth masking parity for read/list responses

- keep oauth secret decrypt to runtime token exchange paths

- expand regression coverage for encryption and masking behavior

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: email auth timing hardening and behavior consistency

Refs: A-06

- add dummy password verification on early login failures

- enforce configurable minimum failed-login response duration

- add focused regression tests for timing guard paths

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: outbound url validation hardening and behavior consistency

Refs: S-02, S-03

- validate admin gateway test base URL before outbound requests

- validate llmchat connect server URL before session setup

- add regression tests for strict local/private URL rejection

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* test: regression coverage hardening and behavior consistency

Refs: A-02, A-05, A-06, O-10, O-17

- add branch-focused regression tests for oauth secret handling and runtime decrypt guards

- add legacy update-object coverage for server oauth update path

- align helper docstrings with linting policy requirements

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Update tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: hardening consistency for oauth storage, auth timing, and SSRF validation (A-02 A-05 A-06 O-10 O-17 S-02 S-03)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: harden admin endpoints and align load-test payloads

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: cafalchio <mcafalchio@gmail.com>
vishu-bh pushed a commit that referenced this pull request Feb 24, 2026
…utbound URL validation (h-batch-6) (#3115)

* fix: oauth config hardening and behavior consistency

Refs: A-02, A-05, O-10, O-17

- centralize oauth secret protection for service-layer CRUD

- add server oauth masking parity for read/list responses

- keep oauth secret decrypt to runtime token exchange paths

- expand regression coverage for encryption and masking behavior

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: email auth timing hardening and behavior consistency

Refs: A-06

- add dummy password verification on early login failures

- enforce configurable minimum failed-login response duration

- add focused regression tests for timing guard paths

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: outbound url validation hardening and behavior consistency

Refs: S-02, S-03

- validate admin gateway test base URL before outbound requests

- validate llmchat connect server URL before session setup

- add regression tests for strict local/private URL rejection

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* test: regression coverage hardening and behavior consistency

Refs: A-02, A-05, A-06, O-10, O-17

- add branch-focused regression tests for oauth secret handling and runtime decrypt guards

- add legacy update-object coverage for server oauth update path

- align helper docstrings with linting policy requirements

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Update tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: hardening consistency for oauth storage, auth timing, and SSRF validation (A-02 A-05 A-06 O-10 O-17 S-02 S-03)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: harden admin endpoints and align load-test payloads

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

revisit Revisit this PR at a later date to address further issues, or if problems arise. security Improves security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant