Skip to content

fix(config): reject path traversal in policy_bundle_path and catalog_path (CONF-004) - #224

Merged
imran-siddique merged 1 commit into
mainfrom
fix/security-medium-conf-004
Jun 7, 2026
Merged

fix(config): reject path traversal in policy_bundle_path and catalog_path (CONF-004)#224
imran-siddique merged 1 commit into
mainfrom
fix/security-medium-conf-004

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

Summary

  • policy_bundle_path and catalog_path from the config YAML were used without sanitization — an operator or env-injection attack could supply ../../etc/passwd to make the gateway attempt loading arbitrary filesystem paths
  • Added _check_no_traversal() that rejects any path containing .. components (both POSIX and Windows path parsing)
  • Hash verification (CMCP_POLICY_HASH, CMCP_CATALOG_HASH) provides a second layer of protection in production

Fixes #182.

Test plan

  • pytest tests/unit/test_config.py — all 14 pass including 4 new CONF-004 tests
  • pytest full suite — no regressions

…path (CONF-004)

Closes #182.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@imran-siddique
imran-siddique merged commit 55e8e63 into main Jun 7, 2026
0 of 7 checks passed
@imran-siddique
imran-siddique deleted the fix/security-medium-conf-004 branch July 29, 2026 23:20
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.

MEDIUM: CMCP_POLICY_PATH traversal not checked — policy file can be loaded from outside config dir (CONF-004)

1 participant