Skip to content

[security] fix(providers): reject insecure credentialed endpoint overrides - #1236

Closed
Hinotoi-agent wants to merge 4 commits into
steipete:mainfrom
Hinotoi-agent:harden-credentialed-endpoint-overrides
Closed

[security] fix(providers): reject insecure credentialed endpoint overrides#1236
Hinotoi-agent wants to merge 4 commits into
steipete:mainfrom
Hinotoi-agent:harden-credentialed-endpoint-overrides

Conversation

@Hinotoi-agent

@Hinotoi-agent Hinotoi-agent commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR hardens the credentialed endpoint override boundary for the MiniMax and Alibaba Coding Plan providers.

  • Rejects explicit non-HTTPS endpoint overrides before provider web/API usage requests can resolve or send credentials.
  • Preserves trusted HTTPS overrides and bare host/path compatibility by continuing to compose bare values as HTTPS URLs.
  • Adds provider-specific validation errors so unsafe endpoint configuration fails closed instead of silently falling through.
  • Adds regression coverage for settings readers, URL composition, and web strategy entry points that should reject invalid overrides before credential discovery.

Security issues covered

Issue Impact Severity
Non-HTTPS credentialed endpoint overrides for MiniMax and Alibaba Coding Plan A local configuration/environment override could direct browser-derived cookies or authorization headers toward http:// or another non-HTTPS endpoint during usage fetching. Moderate

Before this PR

  • MINIMAX_*_URL, MINIMAX_HOST, ALIBABA_CODING_PLAN_QUOTA_URL, and ALIBABA_CODING_PLAN_HOST accepted explicit URL schemes inconsistently across settings readers, URL builders, and fetch strategies.
  • Some helper methods returned nil for non-HTTPS values, but higher-level fetch paths could still continue into fallback behavior or credential discovery.
  • Web strategies did not consistently validate endpoint overrides before resolving cached, manual, or browser-derived cookie material.
  • Tests covered normal endpoint construction but did not lock the “reject before credentials” boundary for unsafe explicit schemes.

After this PR

  • Explicit endpoint overrides with http://, ftp://, or any non-HTTPS scheme fail closed with provider-specific invalidEndpointOverride errors.
  • Bare host/path override values, including bare host:port values, remain supported and continue to be normalized to HTTPS where URL construction is needed.
  • MiniMax and Alibaba web strategies validate endpoint overrides before resolving browser/session credentials.
  • Regression tests cover invalid explicit schemes, preserved HTTPS/bare-host behavior, and early strategy rejection before credential discovery.

Compatibility decision: explicit http:// overrides fail closed

This PR intentionally treats explicit non-HTTPS endpoint override URLs as unsupported for MiniMax and Alibaba Coding Plan credentialed usage fetches. That is a compatibility break for local/debug setups that deliberately set values such as MINIMAX_REMAINS_URL=http://localhost:8080/remains or ALIBABA_CODING_PLAN_QUOTA_URL=http://localhost:8080/data/api.json.

The supported compatibility paths are:

  • explicit https://... override URLs;
  • bare host/path values, including bare host:port values such as localhost:8443/path, which are normalized to HTTPS by the application.

The security decision is to fail closed for explicit http:// or other non-HTTPS schemes before credential discovery or request construction, rather than allowing provider cookies/API keys to be resolved for a plaintext endpoint.

Why this matters

MiniMax and Alibaba Coding Plan usage fetches can attach sensitive provider session material to outbound requests. Endpoint override variables are useful for trusted local development and deployment customization, but a credentialed request should not proceed when an override explicitly selects plaintext HTTP or another non-HTTPS transport.

Failing closed at the settings and strategy boundary prevents accidental credential delivery to unsafe endpoints while keeping the intended trusted HTTPS override workflow intact.

Attack flow

Local configuration or environment sets a provider endpoint override to http://localhost:8080/...
    -> CodexBar usage fetch path runs for MiniMax or Alibaba Coding Plan
        -> endpoint override is not rejected before credential discovery
            -> browser, cached, or manual provider credentials can be resolved
                -> request can be composed for the non-HTTPS override
                    -> sensitive provider session material can be sent to an unsafe endpoint

Affected code

Issue Files
Non-HTTPS credentialed endpoint overrides Sources/CodexBarCore/Providers/MiniMax/MiniMaxSettingsReader.swift, Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift, Sources/CodexBarCore/Providers/MiniMax/MiniMaxProviderDescriptor.swift, Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift, Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift, Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanProviderDescriptor.swift

Root cause

Non-HTTPS credentialed endpoint overrides

  • Direct cause: explicit endpoint schemes were parsed or ignored inconsistently instead of being treated as configuration errors when the scheme was not HTTPS.
  • Boundary failure: credentialed web-fetch strategies did not validate endpoint override configuration before discovering or using browser/session credentials.

CVSS assessment

Issue CVSS v3.1 Vector
Non-HTTPS credentialed endpoint overrides 5.5 Medium CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N

Rationale:

  • The control point is local configuration or environment influence, and the application/user must execute the affected usage fetch path.
  • The impact is bounded to confidentiality of provider session material that could be sent to a non-HTTPS endpoint.
  • Scope is unchanged, and this PR does not claim unauthenticated remote reachability.

Safe reproduction steps

1. MiniMax invalid endpoint override

  1. Configure a MiniMax web endpoint override with an explicit non-HTTPS URL, for example MINIMAX_REMAINS_URL=http://localhost:8080/remains.
  2. Trigger the MiniMax web usage fetch strategy.
  3. On vulnerable code, the strategy can continue toward credential discovery/fetch behavior instead of rejecting the unsafe override at entry.
  4. After this PR, the strategy throws MiniMaxSettingsError.invalidEndpointOverride("MINIMAX_REMAINS_URL") before browser credential discovery.

2. Alibaba Coding Plan invalid endpoint override

  1. Configure an Alibaba Coding Plan endpoint override with an explicit non-HTTPS URL, for example ALIBABA_CODING_PLAN_QUOTA_URL=http://localhost:8080/data/api.json.
  2. Trigger the Alibaba Coding Plan API or web usage fetch path.
  3. On vulnerable code, the fetch path can proceed with inconsistent override handling instead of treating the override as unsafe configuration.
  4. After this PR, the path throws AlibabaCodingPlanSettingsError.invalidEndpointOverride("ALIBABA_CODING_PLAN_QUOTA_URL") before credentialed request construction.

Expected vulnerable behavior

  • Explicit non-HTTPS endpoint overrides should never be accepted for credentialed provider usage requests.
  • Pre-patch behavior allowed invalid override values to be ignored or handled inconsistently across settings readers, URL builders, and strategy boundaries.
  • The safe proof signal is the new regression coverage and focused smoke validation asserting that invalid overrides throw before browser/cookie resolution or credentialed request construction.

Changes in this PR

  • Adds validateEndpointOverrides helpers for MiniMax and Alibaba Coding Plan settings.
  • Rejects explicit non-HTTPS schemes while preserving HTTPS, bare-host, and bare host:port compatibility.
  • Validates endpoint overrides in web fetch strategies before cookie lookup or credentialed fetch work.
  • Keeps URL construction helpers defensive by returning nil for explicit non-HTTPS URLs.
  • Adds provider-specific invalidEndpointOverride errors.
  • Adds regression tests for invalid-scheme rejection and preserved HTTPS/bare-host behavior.

Files changed

Category Files What changed
Settings validation MiniMaxSettingsReader.swift, AlibabaCodingPlanSettingsReader.swift Added explicit endpoint override validation and provider-specific errors.
Request construction MiniMaxUsageFetcher.swift, AlibabaCodingPlanUsageFetcher.swift Preserved HTTPS-only URL composition for override-based requests.
Strategy boundary MiniMaxProviderDescriptor.swift, AlibabaCodingPlanProviderDescriptor.swift Validate overrides before resolving cookies or fetching usage.
Tests MiniMaxProviderTests.swift, AlibabaCodingPlanProviderTests.swift Added settings, URL composition, and strategy regression coverage.

Maintainer impact

  • Scope is limited to MiniMax and Alibaba Coding Plan endpoint override handling.
  • Existing HTTPS override behavior remains supported.
  • Bare host/path override values, including bare host:port values, still work and continue to be normalized to HTTPS.
  • Local wrappers or debug setups that intentionally use explicit http:// overrides for these credentialed provider fetches will now fail closed.
  • Unrelated providers, UI behavior, storage paths, and non-provider code paths are untouched.

Fix rationale

  • The credential boundary belongs before cookie discovery and request construction, not after a request URL has already been selected.
  • Treating explicit non-HTTPS schemes as configuration errors avoids silent fallback behavior that can mask unsafe override configuration.
  • Preserving bare host/path support keeps the existing trusted customization workflow while ensuring the transport selected by the application remains HTTPS.
  • Covering both settings helpers and strategy entry points protects the low-level parser behavior and the high-level credential boundary.

Type of change

  • Security fix
  • Tests
  • Documentation update
  • Refactor with no behavior change

Test plan

  • git diff --check
  • swift build --target CodexBarCore
  • Focused endpoint override smoke compiled with swiftc: verified bare host:port values normalize to HTTPS/preserve host+port+path, and explicit http:// values reject for Alibaba and MiniMax
  • ./Scripts/lint.sh lint partially completed: Codex parser hash was current, lint tools were pinned/current, SwiftFormat reported 0/991 files require formatting; SwiftLint then failed in this local CLT environment while loading sourcekitdInProc
  • Direct touched-file SwiftFormat lint: 0/4 files require formatting
  • GitHub Actions before this follow-up push: lint-build-test, build-linux-cli (linux-x64, ubuntu-24.04), build-linux-cli (linux-arm64, ubuntu-24.04-arm), and GitGuardian Security Checks passed
  • Local focused swift test --filter 'AlibabaCodingPlanSettingsReaderTests|MiniMaxSettingsReaderTests' did not complete in this local toolchain because unrelated dependency/test-target compilation failed before the focused tests ran

Executed with:

$ git diff --check

$ swift build --target CodexBarCore
Build of target: 'CodexBarCore' complete! (7.20s)

$ swiftc Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift Sources/CodexBarCore/Providers/MiniMax/MiniMaxCookieHeader.swift Sources/CodexBarCore/Providers/MiniMax/MiniMaxSettingsReader.swift /tmp/main.swift -o /tmp/codexbar_endpoint_override_smoke
$ /tmp/codexbar_endpoint_override_smoke
PASS expected rejection: Alibaba explicit http quota URL: Alibaba Coding Plan endpoint override ALIBABA_CODING_PLAN_QUOTA_URL must use HTTPS or a bare host.
PASS expected rejection: MiniMax explicit http coding URL: MiniMax endpoint override MINIMAX_CODING_PLAN_URL must use HTTPS or a bare host.
PASS endpoint override smoke: bare host:port normalizes to https; explicit http rejects for Alibaba and MiniMax

$ ./Scripts/lint.sh lint
Codex parser hash is current (c55f8a5a2d69092d)
==> Lint tools already installed (0.59.1, 0.63.2)
SwiftFormat completed in 0.16s.
0/991 files require formatting.
SourceKittenFramework/library_wrapper.swift:58: Fatal error: Loading sourcekitdInProc.framework/Versions/A/sourcekitdInProc failed

$ .build/lint-tools/bin/swiftformat Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift Sources/CodexBarCore/Providers/MiniMax/MiniMaxSettingsReader.swift Tests/CodexBarTests/AlibabaCodingPlanProviderTests.swift Tests/CodexBarTests/MiniMaxProviderTests.swift --lint
SwiftFormat completed in 0.02s.
0/4 files require formatting.

$ swift test --filter 'AlibabaCodingPlanSettingsReaderTests|MiniMaxSettingsReaderTests'
.build/checkouts/KeyboardShortcuts/Sources/KeyboardShortcuts/Recorder.swift:172:1: error: external macro implementation type 'PreviewsMacros.SwiftUIView' could not be found for macro 'Preview(_:body:)'

The temporary smoke file and binary were removed after the proof run. No real provider credentials were used.

Disclosure notes

  • No production endpoints or real provider credentials were used while validating this patch.
  • This PR is bounded to local configuration/environment endpoint override influence and credentialed provider usage-fetch requests.
  • This PR does not claim unauthenticated remote code execution, external network reachability, or compromise without local configuration/control conditions.
  • No unrelated files are changed.

Latest validation update (55d63ed)

This follow-up addresses the ClawSweeper host:port resolver and pre-availability validation blockers on the current PR head.

Changes since the previous proof:

  • MiniMax and Alibaba usage URL builders now distinguish real explicit URL schemes from bare host:port values, so localhost:8443 is normalized as an HTTPS host override instead of being mistaken for a URL scheme.
  • MiniMax and Alibaba invalid endpoint override validation now runs before availability/cookie/keychain/token probes in the normal provider pipeline.
  • Invalid endpoint override diagnostics are categorized as configuration, including fetch-attempt text that contains endpoint override wording before auth/API keywords.
  • Added focused regression coverage for MiniMax and Alibaba localhost:8443 resolver paths, pre-credential invalid override rejection, and diagnostic categorization.

Real usage-path smoke proof, run through a temporary external SwiftPM harness importing this checkout's CodexBarCore product with no real provider credentials:

$ XCTestConfigurationFilePath=/tmp/fake.xctest swift run EndpointSmoke
PASS MiniMax MINIMAX_HOST=localhost:8443 request URL: https://localhost:8443/user-center/payment/coding-plan?cycle_type=3
PASS MiniMax credential header redacted: Cookie=[REDACTED]
PASS MiniMax usage path accepted bare host:port override over HTTPS
PASS Alibaba API ALIBABA_CODING_PLAN_HOST=localhost:8443 request URL: https://localhost:8443/data/api.json?action=zeldaEasy.broadscope-bailian.codingPlan.queryCodingPlanInstanceInfoV2&product=broadscope-bailian&api=queryCodingPlanInstanceInfoV2&currentRegionId=ap-southeast-1
PASS Alibaba API credential headers redacted: Authorization=[REDACTED], x-api-key=[REDACTED]
PASS Alibaba API usage path accepted bare host:port override over HTTPS before controlled rejection
PASS Alibaba cookie rejected invalid explicit override before request: ALIBABA_CODING_PLAN_QUOTA_URL

Local validation on the current pushed head:

$ git diff --check
# passed

$ swift build --target CodexBarCore
Build of target: 'CodexBarCore' complete! (6.40s)

$ swift test --filter 'ProviderDiagnosticExportTests|MiniMaxProviderStrategyTests|MiniMaxUsageParserTests|MiniMaxAPIRegionTests|AlibabaCodingPlanFallbackTests|AlibabaCodingPlanRegionTests|AlibabaCodingPlanUsageFetcherRequestTests'
TestsLinux/JetBrainsParserLinuxTests.swift:3:8: error: no such module 'Testing'

The focused repository swift test command is still blocked before the selected tests execute by this local Command Line Tools test-target/toolchain issue (TestsLinux importing Testing). The security-relevant behavior above was exercised through the temporary external harness to avoid live credential prompts and avoid importing the repo test targets.

Latest validation

Current pushed head: 5c0749eb887ec199a7f6b16820d87e7588352f33

Local validation on this head:

  • git diff --check
  • swift build --target CodexBarCore ✅ (Build of target: 'CodexBarCore' complete! (6.96s))
  • ./Scripts/lint.sh lint partially completed: parser hash current, lint tools current, SwiftFormat 0/991 files require formatting; SwiftLint then fails locally while loading sourcekitdInProc from this Command Line Tools environment.
  • Direct standalone swiftformat is not on this PATH, so repo lint tooling was used for the SwiftFormat signal.
  • Focused repository swift test remains blocked locally by the existing Command Line Tools / test-target issue documented below.

The latest code change after the prior security proof is formatting-only in the touched fetcher/test files; no real provider credentials were used.

@clawsweeper

clawsweeper Bot commented May 31, 2026

Copy link
Copy Markdown

Codex review: found issues before merge. Reviewed June 2, 2026, 3:27 AM ET / 07:27 UTC.

Summary
The PR adds HTTPS-only endpoint override validation for MiniMax and Alibaba Coding Plan credentialed usage paths, preserves bare host:port HTTPS normalization, updates diagnostics, and expands regression coverage.

Reproducibility: yes. at source level: current main accepts explicit non-HTTPS override schemes in the MiniMax and Alibaba settings readers, and the PR body includes dummy-harness output showing after-fix rejection before credentialed work. I did not run local tests because this review must keep the checkout read-only and avoid live credential/keychain paths.

Review metrics: 3 noteworthy metrics.

  • Merge surface: 10 files, +638/-42. The patch is focused on two providers plus shared diagnostics/tests, but the compatibility-sensitive surface is larger than a one-line parser fix.
  • Provider scope: 2 credentialed providers. MiniMax and Alibaba Coding Plan both send cookies or API keys, so endpoint override policy affects credential handling.
  • Test coverage changed: 3 test files expanded. The PR adds regression coverage for settings parsing, strategy entry validation, URL composition, and diagnostic categories.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Get explicit maintainer sign-off on failing explicit http:// endpoint overrides closed for these credentialed providers.
  • Narrow the diagnostic keyword ordering so only endpoint override errors jump ahead of auth/network/API categories.

Risk before merge

  • [P1] Merging intentionally breaks local/debug setups that use explicit http:// MiniMax or Alibaba endpoint overrides; maintainers need to accept that no insecure local-dev escape hatch is required.
  • [P1] The diff changes a credentialed provider security boundary, so the fail-closed behavior should receive explicit maintainer approval even though the direction is security-positive.
  • [P1] The diagnostic keyword ordering change can misclassify existing auth/API/network messages containing “unavailable” as configuration.

Maintainer options:

  1. Accept fail-closed HTTP overrides
    Maintainers can approve the intentional break for explicit plaintext overrides after confirming HTTPS and bare-host paths cover supported use cases.
  2. Add an explicit insecure local-dev escape hatch
    If plaintext local wrappers are supported, add a narrowly named opt-in setting plus tests proving default HTTPS behavior and opt-in insecure behavior.
  3. Pause for provider security policy
    If the permanent endpoint override policy is unclear, hold or close this PR until maintainers choose the supported contract for credentialed provider overrides.

Next step before merge

  • [P2] A human maintainer should approve the compatibility/security boundary before merge; the remaining diagnostic cleanup is small but not the primary blocker.

Security
Cleared: No supply-chain or secret-handling expansion was found; the diff tightens credential transport boundaries, with the compatibility tradeoff tracked separately as merge risk.

Review findings

  • [P3] Keep unavailable behind auth and network checks — Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift:180-181
Review details

Best possible solution:

Land the scoped endpoint hardening after maintainer sign-off on the fail-closed HTTP policy, with the diagnostic keyword ordering narrowed before merge.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: current main accepts explicit non-HTTPS override schemes in the MiniMax and Alibaba settings readers, and the PR body includes dummy-harness output showing after-fix rejection before credentialed work. I did not run local tests because this review must keep the checkout read-only and avoid live credential/keychain paths.

Is this the best way to solve the issue?

Mostly yes: failing closed before credential discovery is the narrow security fix, and the PR preserves HTTPS and bare host:port compatibility. The remaining concerns are maintainer approval of the intentional plaintext override break and narrowing the diagnostic heuristic.

Full review comments:

  • [P3] Keep unavailable behind auth and network checks — Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift:180-181
    Moving the broad unavailable keyword ahead of the auth/network/API checks makes existing messages such as “Claude OAuth token is still unavailable after delegated Claude CLI refresh” categorize as configuration instead of auth. Please special-case endpoint override before the other checks, but leave generic unavailable behind the more specific categories.
    Confidence: 0.83

Overall correctness: patch is correct
Overall confidence: 0.82

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against dc4e4835bc6e.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and follow-up comments include after-fix terminal/live-output smoke proof using dummy/redacted credentials for invalid override rejection and bare host:port HTTPS normalization.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded provider security hardening with meaningful but limited compatibility impact.
  • merge-risk: 🚨 compatibility: Explicit http:// endpoint override setups for MiniMax and Alibaba will fail closed after merge.
  • merge-risk: 🚨 security-boundary: The PR changes when credentialed provider paths validate endpoint overrides before cookie/token discovery and request construction.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and follow-up comments include after-fix terminal/live-output smoke proof using dummy/redacted credentials for invalid override rejection and bare host:port HTTPS normalization.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and follow-up comments include after-fix terminal/live-output smoke proof using dummy/redacted credentials for invalid override rejection and bare host:port HTTPS normalization.
Evidence reviewed

What I checked:

Likely related people:

  • steipete: Peter Steinberger has the densest recent history across MiniMax, Alibaba, and ProviderDiagnosticExport, including diagnostic export generalization and multiple provider follow-ups. (role: recent area contributor; confidence: high; commits: 83ed8e405541, 197a2df946f2, af202b462bdf; files: Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift, Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift, Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift)
  • ratulsarna: ratulsarna introduced the Alibaba Coding Plan provider and has adjacent MiniMax provider history, making them a useful routing candidate for provider override behavior. (role: introduced behavior; confidence: medium; commits: 043cebd3830e, 0422dd1b1cea, 609eb6b617f1; files: Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift, Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift, Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift)
  • soumikbhatta: soumikbhatta recently touched provider/diagnostic-adjacent code in the current history, so they may have useful context for diagnostic export categorization. (role: recent adjacent contributor; confidence: low; commits: 96745231187f; files: Sources/CodexBarCore/Providers/ProviderDiagnosticExport.swift, Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift, Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f29828a6a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Sources/CodexBarCore/Providers/MiniMax/MiniMaxSettingsReader.swift Outdated
Comment thread Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanSettingsReader.swift Outdated
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 31, 2026
@Hinotoi-agent Hinotoi-agent changed the title Reject insecure credentialed endpoint overrides [security] fix(providers): reject insecure credentialed endpoint overrides May 31, 2026
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels May 31, 2026
@Hinotoi-agent
Hinotoi-agent force-pushed the harden-credentialed-endpoint-overrides branch from 8f29828 to e520e71 Compare May 31, 2026 03:17
@Hinotoi-agent

Copy link
Copy Markdown
Contributor Author

Addressed the fail-closed feedback in the latest push (e520e71).

What changed:

  • invalid explicit MiniMax overrides now throw MiniMaxSettingsError.invalidEndpointOverride(...) before credentialed fetch setup;
  • invalid explicit Alibaba Coding Plan quota/host overrides now throw AlibabaCodingPlanSettingsError.invalidEndpointOverride(...) before API-key/cookie fetch setup;
  • HTTPS overrides and bare hosts remain accepted;
  • added fetcher-level regression coverage, including a MiniMax stub transport assertion that no request is sent when an invalid override is present;
  • updated the PR body with the real local validation output and the local test-target blockers.

Local validation:

  • swift build --target CodexBarCore
  • git diff --check
  • swift test --filter 'MiniMax|AlibabaCodingPlan' is still blocked locally before the focused tests run by unrelated test-target/toolchain setup issues (KeyboardShortcuts PreviewsMacros and TestsLinux importing Testing).

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e520e71813

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift
@Hinotoi-agent
Hinotoi-agent force-pushed the harden-credentialed-endpoint-overrides branch from e520e71 to da442a7 Compare May 31, 2026 03:25
@Hinotoi-agent
Hinotoi-agent force-pushed the harden-credentialed-endpoint-overrides branch from da442a7 to 1ea8f96 Compare May 31, 2026 03:50
@Hinotoi-agent

Hinotoi-agent commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

Pushed an update at 1ea8f96 addressing the strategy-entry validation feedback.

What changed:

  • MiniMax web strategy now validates endpoint overrides at the start of MiniMaxCodingPlanFetchStrategy.fetch, before cookie override resolution, cached cookie reads, local token context loading, or browser cookie import.
  • Alibaba web strategy now validates endpoint overrides at the start of AlibabaCodingPlanWebFetchStrategy.fetch, before resolveCookieHeader can read/import/cache cookies.
  • Added strategy-level regression tests for both providers asserting invalid non-HTTPS overrides throw before credential discovery.
  • Updated the PR body with current local validation output and the remaining local test-target blocker.

Local validation run on the current head:

  • swift build --target CodexBarCore
  • git diff --check origin/main...HEAD
  • swift test --filter 'MiniMaxProviderStrategyTests|AlibabaCodingPlanSettingsReaderTests' remains blocked locally by the unrelated KeyboardShortcuts / PreviewsMacros.SwiftUIView dependency compilation issue before the focused tests run.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 31, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 31, 2026
@Hinotoi-agent

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please re-review the latest PR head.

@clawsweeper

clawsweeper Bot commented May 31, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels May 31, 2026
@Hinotoi-agent

Copy link
Copy Markdown
Contributor Author

Pushed follow-up commits through 04d1daf addressing the strategy-entry validation feedback.

What changed:

  • MiniMax web strategy now validates endpoint overrides at the start of MiniMaxCodingPlanFetchStrategy.fetch, before cookie override resolution, cached cookie reads, local token context loading, or browser cookie import.
  • Alibaba web strategy now validates endpoint overrides at the start of AlibabaCodingPlanWebFetchStrategy.fetch, before resolveCookieHeader can read/import/cache cookies.
  • Added strategy-level regression tests for both providers asserting invalid non-HTTPS overrides throw before credential discovery/request construction.
  • Updated the PR body with current local validation output and the remaining local test-target blocker.

Local validation run on the current head:

  • swift build --target CodexBarCore
  • git diff --check origin/main...HEAD
  • Alibaba redacted CLI smoke checks for non-HTTPS API/web overrides fail closed with provider errors requiring HTTPS or a bare host ✅
  • MiniMax regression proof is source/test-level: the new strategy test calls MiniMaxCodingPlanFetchStrategy().fetch(...) with MINIMAX_REMAINS_URL=http://localhost:8080/remains and expects MiniMaxSettingsError.invalidEndpointOverride before browser credential discovery. A direct CLI smoke run with fake MiniMax cookie stops earlier at No available fetch strategy for minimax, so I am not using that as the proof signal.
  • swift test --filter 'MiniMaxProviderStrategyTests|MiniMaxUsageFetcherSecurityTests|AlibabaCodingPlanProviderTests|AlibabaTokenPlanProviderTests|MiniMaxSettingsReaderTests' remains blocked locally before the focused tests run by unrelated local test-target/dependency compilation failures: TestsLinux/...: no such module 'Testing' and KeyboardShortcuts / PreviewsMacros.SwiftUIView.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 31, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Jun 1, 2026
@Hinotoi-agent

Copy link
Copy Markdown
Contributor Author

Pushed d7564fbf to address the remaining host:port compatibility feedback and make the http:// compatibility decision explicit.

What changed:

  • MiniMax and Alibaba endpoint scheme detection now distinguishes real explicit URL schemes from bare host:port values.
  • Bare localhost:8443 / localhost:8443/path overrides continue through the HTTPS normalization path.
  • Explicit non-HTTPS URLs such as http://localhost:8443/... still fail closed with provider-specific invalidEndpointOverride errors.
  • Added regression coverage for bare host:port values on both provider host overrides and full URL override helpers.
  • Updated the PR body with an explicit “Compatibility decision: explicit http:// overrides fail closed” section.

Local validation on the pushed head:

  • git diff --check
  • swift build --target CodexBarCore
  • Focused swiftc smoke harness ✅
    • verified bare host:port normalizes to HTTPS and preserves host/port/path for Alibaba and MiniMax
    • verified explicit http:// rejects for Alibaba and MiniMax
  • ./Scripts/lint.sh lint partially completed: parser hash current, lint tools current, SwiftFormat 0/991 files require formatting; SwiftLint then failed locally while loading sourcekitdInProc from this Command Line Tools environment.
  • Direct touched-file SwiftFormat lint passed with 0/4 files require formatting
  • Focused swift test --filter 'AlibabaCodingPlanSettingsReaderTests|MiniMaxSettingsReaderTests' is still blocked locally before the focused tests run by the unrelated KeyboardShortcuts / PreviewsMacros.SwiftUIView toolchain issue.

No real provider credentials were used; the temporary smoke harness and binary were removed after the proof run.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 1, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 1, 2026
@Hinotoi-agent
Hinotoi-agent force-pushed the harden-credentialed-endpoint-overrides branch from d7564fb to 55d63ed Compare June 2, 2026 07:01
@Hinotoi-agent

Copy link
Copy Markdown
Contributor Author

Pushed 55d63eda addressing the latest ClawSweeper blockers.

What changed:

  • MiniMax and Alibaba usage URL builders now preserve bare localhost:8443 host overrides by treating only values with an explicit :// URL scheme marker as explicit URLs.
  • Bare host:port overrides now normalize to HTTPS and preserve host/port/path through the real usage resolver paths.
  • Invalid MiniMax/Alibaba endpoint overrides are validated before availability/cookie/keychain/token probes in the provider pipeline.
  • Invalid endpoint override diagnostics now categorize as configuration, including fetch-attempt descriptions that also contain auth/API-ish wording.
  • Added focused tests covering the resolver paths, invalid override pre-credential rejection, and diagnostic categorization.

Validation on the pushed head:

  • git diff --check
  • swift build --target CodexBarCore ✅ (Build of target: 'CodexBarCore' complete! (6.40s))
  • External SwiftPM usage-path smoke harness ✅

Smoke proof, with credentials redacted and no real provider credentials used:

PASS MiniMax MINIMAX_HOST=localhost:8443 request URL: https://localhost:8443/user-center/payment/coding-plan?cycle_type=3
PASS MiniMax credential header redacted: Cookie=[REDACTED]
PASS MiniMax usage path accepted bare host:port override over HTTPS
PASS Alibaba API ALIBABA_CODING_PLAN_HOST=localhost:8443 request URL: https://localhost:8443/data/api.json?action=zeldaEasy.broadscope-bailian.codingPlan.queryCodingPlanInstanceInfoV2&product=broadscope-bailian&api=queryCodingPlanInstanceInfoV2&currentRegionId=ap-southeast-1
PASS Alibaba API credential headers redacted: Authorization=[REDACTED], x-api-key=[REDACTED]
PASS Alibaba API usage path accepted bare host:port override over HTTPS before controlled rejection
PASS Alibaba cookie rejected invalid explicit override before request: ALIBABA_CODING_PLAN_QUOTA_URL

Focused repository swift test is still locally blocked before the selected tests execute by the Command Line Tools test-target/toolchain issue:

TestsLinux/JetBrainsParserLinuxTests.swift:3:8: error: no such module 'Testing'

The PR body is updated with this current proof. The explicit non-HTTPS override policy remains fail-closed for credentialed provider paths; maintainers should still sign off on that compatibility/security tradeoff.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 2, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 2, 2026
@Hinotoi-agent
Hinotoi-agent force-pushed the harden-credentialed-endpoint-overrides branch from 55d63ed to 5c0749e Compare June 2, 2026 07:20
@Hinotoi-agent

Copy link
Copy Markdown
Contributor Author

Pushed 5c0749eb as a formatting-only follow-up after the latest ClawSweeper review.

What changed in this push:

  • Reformatted the touched MiniMax/Alibaba fetcher signatures and the Alibaba diagnostic expectation blocks.
  • No behavior changes beyond the already-reviewed endpoint override hardening.

Validation on the pushed head:

  • git diff --check
  • swift build --target CodexBarCore ✅ (Build of target: 'CodexBarCore' complete! (6.96s))
  • ./Scripts/lint.sh lint partially completed: parser hash current, lint tools current, SwiftFormat 0/991 files require formatting; SwiftLint then fails locally while loading sourcekitdInProc from this Command Line Tools environment.
  • Focused repository swift test remains locally blocked by the existing Command Line Tools/test-target issue already documented on the PR.

The PR body is updated for the current head. No real provider credentials were used.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 2, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 2, 2026
@steipete

Copy link
Copy Markdown
Owner

Thanks for the detailed security work and proof. Closing this branch as superseded by #1269, which now carries the canonical MiniMax and Alibaba endpoint-override hardening with the shared validator, broader authority checks, compatibility policy, documentation, tests, and a newer main integration.

Maintaining both branches for the same provider boundary no longer makes sense; the work and discussion here remain useful provenance for #1269.

@steipete steipete closed this Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants