[security] fix(ohmo): secure default remote channel allowlists#147
Merged
tjb-tech merged 1 commit intoHKUDS:mainfrom Apr 15, 2026
Merged
Conversation
Contributor
Author
|
Added a detailed distinction section to the PR body:
That section now explains, in maintainer terms, why this PR is a related variant rather than a duplicate:
If useful, the shortest framing is:
|
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR hardens the remote-channel admission boundary for ohmo/OpenHarness by making channel allowlists secure by default instead of implicitly trusting every remote sender.
It addresses a verified gateway-adjacent variant of the trust-boundary family previously discussed in
HKUDS/OpenHarness#127:allow_from = ["*"]Security issues covered
Before this PR
allow_from = ["*"]from the default channel config model*, which silently opened access to every remote sender unless the operator noticed and changed itChannelManagertreated an empty allowlist as fatal startup misconfiguration, which made a deny-all secure default impossible to keep enabled#127After this PR
**for open accessExplicit operator choice
Secure default example:
{ "enabled_channels": ["telegram"], "channel_configs": { "telegram": { "allow_from": [], "token": "..." } } }Explicitly open example:
{ "enabled_channels": ["telegram"], "channel_configs": { "telegram": { "allow_from": ["*"], "token": "..." } } }When disabled/blank:
When explicitly enabled with
*:Why this matters
*, any remote sender who can reach the configured channel can drive a host-backed agent session#127, but it lives one layer earlier at channel admission rather than slash-command privilege checksHow this differs from
HKUDS/OpenHarness#127This PR is related to
#127, but it fixes a different issue and a different layer of the remote trust boundary.1. Different boundary
#127hardened what an already-admitted remote user could do after entering the gateway path/memory showreading outside its intended directory#127= command/path enforcement after remote entry2. Different trigger condition
#127required a remote user to reach the gateway slash-command surface and then invoke a dangerous command pathallow_from = ["*"]#127is present3. Different vulnerable code
#127changed:ohmo/gateway/runtime.pyohmo/gateway/models.pyohmo/gateway/service.pyohmo/workspace.pysrc/openharness/commands/registry.pyThis PR changes a different set of files tied to admission defaults and operator configuration:
src/openharness/config/schema.pysrc/openharness/channels/impl/manager.pyohmo/cli.pytests/test_ohmo/test_cli.pyThat file split reflects the boundary split:
#127patched runtime command handling and one file-read command path4. Different failure mode
#127was about dangerous behavior remaining remotely reachable for users who had already crossed the gateway admission boundary5. Why this is a variant instead of a duplicate
#127: dangerous remote command/file-read paths after admission#127does not remove this earlier-layer wildcard-admission behavior#127Attack flow
Affected code
src/openharness/config/schema.py,src/openharness/channels/impl/manager.py,ohmo/cli.py,tests/test_ohmo/test_cli.pyRoot cause
Issue 1: insecure default remote channel allowlist
allow_fromto[*], which made open remote admission the implicit behavior for newly enabled channelsCVSS assessment
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:NRationale:
#127command-level issue because this PR does not rely on privileged admin-command acceptance; it fixes the admission boundary itselfSafe reproduction steps
1. Insecure default remote channel allowlist
allow_from = ["*"].2. Deny-all secure default was previously impossible
allow_fromlist to intentionally deny all remote senders until explicit rollout.Expected vulnerable behavior
Changes in this PR
BaseChannelConfig.allow_fromto default to an empty list instead of[*]ChannelManagerso an empty allowlist becomes a warning-backed secure default instead of a fatal startup error*Files changed
src/openharness/config/schema.pysrc/openharness/channels/impl/manager.pyohmo/cli.pytests/test_ohmo/test_cli.pyMaintainer impact
#127allow_from = ["*"]keep working as-isFix rationale
Reference patterns from other software
These systems are not identical products, but they reflect the same secure-default principle: remote or untrusted principals should not inherit privileged access merely because a capability was enabled.
Type of change
Test plan
uv run --extra dev pytest tests/test_ohmo/test_cli.py -quv run --extra dev ruff check src/openharness/config/schema.py src/openharness/channels/impl/manager.py ohmo/cli.py tests/test_ohmo/test_cli.pyExecuted with:
cd /tmp/openharness && uv run --extra dev pytest tests/test_ohmo/test_cli.py -qcd /tmp/openharness && uv run --extra dev ruff check src/openharness/config/schema.py src/openharness/channels/impl/manager.py ohmo/cli.py tests/test_ohmo/test_cli.pyDisclosure notes
HKUDS/OpenHarness#127#127already covered; it hardens the earlier channel-admission layer that can still expose the host-backed runtime under insecure defaults