Skip to content

[WRONG BRANCH] fix(export): omit provider text with ${...} from Hermes/OpenClaw exports - #44

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-env-interpolation-vulnerability
Draft

[WRONG BRANCH] fix(export): omit provider text with ${...} from Hermes/OpenClaw exports#44
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-env-interpolation-vulnerability

Conversation

@luvs01

@luvs01 luvs01 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Hermes and OpenClaw client exporters were placing provider-controlled model.namespaced and display text directly into interpolation-capable client configs, which could allow a malicious provider to inject ${ENV} sequences that expand to sensitive environment values.
  • The change blocks catalog text that could be interpreted by those clients so exported configs cannot trigger environment-variable interpolation and exfiltrate secrets.

Description

  • Add a small helper containsEnvInterpolation to detect ${...} sequences and prevent provider-controlled strings from being emitted verbatim into interpolation-capable outputs in src/clients/config-export.ts.
  • Update the Hermes exporter to filter out models whose namespaced selector contains interpolation syntax, preserving other valid entries and header injection behavior via proxyAdmissionHeaders.
  • Update the OpenClaw exporter to omit any model whose selector or generated display name contains interpolation syntax, using flatMap to skip offending rows while keeping context-window logic intact.
  • Add a regression test in tests/client-config-new-clients.test.ts that injects malicious catalog rows (containing ${SENSITIVE_ENV}) and asserts that Hermes and OpenClaw omit those entries from the generated configs.

Testing

  • Ran the focused unit tests with node_modules/@oven/bun-linux-x64-baseline/bin/bun test tests/client-config-new-clients.test.ts tests/client-config-export-new-clients.test.ts, and the modified tests passed (48 tests across the two files all passed).
  • Ran static checks and scans with bun run typecheck and bun run privacy:scan, both of which completed successfully in this environment.
  • Attempted the full test suite via bun test, which exercised many unrelated modules but hit existing timeouts in long-running combo/retained-root tests in this environment; those broader failures are unrelated to the export changes.

Codex Task

Summary by CodeRabbit

  • Bug Fixes

    • Prevented generated Hermes and OpenClaw configurations from including model identifiers or display names containing environment-variable syntax.
    • Preserved existing context-window settings for valid exported models.
  • Tests

    • Added coverage to verify interpolation-sensitive model entries are excluded from generated configurations.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@github-actions github-actions Bot changed the title fix(export): omit provider text with ${...} from Hermes/OpenClaw exports [WRONG BRANCH] fix(export): omit provider text with ${...} from Hermes/OpenClaw exports Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft August 7, 2026 11:12
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4c9575c8-2fe0-464c-8cdd-fe7b746320ad

📥 Commits

Reviewing files that changed from the base of the PR and between 2468502 and bcd7587.

📒 Files selected for processing (2)
  • src/clients/config-export.ts
  • tests/client-config-new-clients.test.ts

📝 Walkthrough

Walkthrough

Hermes and OpenClaw exports now exclude model selectors or display names containing ${. Tests verify that unsafe provider-controlled values do not enter generated client configuration.

Changes

Configuration export safety

Layer / File(s) Summary
Filter unsafe model data
src/clients/config-export.ts, tests/client-config-new-clients.test.ts
Hermes excludes selectors containing ${. OpenClaw excludes selectors and generated labels containing ${. Tests cover both cases and verify that safe model identifiers remain exported.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main export-safety change for Hermes and OpenClaw, although the [WRONG BRANCH] prefix is unnecessary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/propose-fix-for-env-interpolation-vulnerability

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant