molecule-core/workspace-server/internal
Molecule AI Core-BE 706df19b43
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 11s
sop-tier-check / tier-check (pull_request) Failing after 11s
[core-be-agent] fix(security#321): CWE-22 path traversal guards in loadWorkspaceEnv
Two vulnerable call sites confirmed on origin/main:

1. org_helpers.go:loadWorkspaceEnv (line 101): filesDir from untrusted org YAML
   joined directly with orgBaseDir without traversal guard. A malicious filesDir
   like "../../../etc" escapes the org root and reads arbitrary files.

2. org_import.go:createWorkspaceTree (line 494): same pattern directly in the
   env-loading block — not covered by staging-targeted PR #345.

Fix (both locations): call resolveInsideRoot(orgBaseDir, filesDir) before
filepath.Join. On traversal detection, org_helpers.go returns an empty map
(caller contract); org_import.go silently skips the workspace .env override
(matches existing template-resolution pattern in the same function).

Tests: org_helpers_test.go — 3 cases covering traversal rejection,
workspace-override happy path, and empty filesDir edge case.

Closes: molecule-core#362, molecule-core#321

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 03:34:55 +00:00
..
artifacts
buildinfo
bundle
channels
crypto
db
envx
events
handlers [core-be-agent] fix(security#321): CWE-22 path traversal guards in loadWorkspaceEnv 2026-05-11 03:34:55 +00:00
imagewatch fix(workspace-server): respect MOLECULE_IMAGE_REGISTRY in imagewatch + admin_workspace_images (RFC #229 P2-4) 2026-05-10 04:21:27 -07:00
memory fix(textutil): SSOT for rune-safe string truncation, fix 3 audit-gap bugs 2026-05-05 23:01:21 -07:00
messagestore feat(canvas/chat-server): canvas consumes /chat-history + server-side row-aware reverse (RFC #2945 PR-C-2) 2026-05-06 16:55:00 -07:00
metrics
middleware docs(ratelimit): tighten dev-mode comment after keyFor refactor 2026-05-07 14:57:21 -07:00
models
orgtoken
pendinguploads fix(test): poll error counter to 0 before asserting in RecordsMetricsOnSuccess 2026-05-09 23:27:19 +00:00
plugins [core-lead-agent] fix(core#228): cascade fixes for PluginResolver — make main compile 2026-05-10 09:46:35 +00:00
provisioner fix(workspace-server): respect MOLECULE_IMAGE_REGISTRY in imagewatch + admin_workspace_images (RFC #229 P2-4) 2026-05-10 04:21:27 -07:00
provlog
registry chore: reconcile main → staging post-suspension divergence 2026-05-07 14:24:37 -07:00
router [core-lead-agent] fix(core#228): cascade fixes for PluginResolver — make main compile 2026-05-10 09:46:35 +00:00
scheduler fix(textutil): SSOT for rune-safe string truncation, fix 3 audit-gap bugs 2026-05-05 23:01:21 -07:00
supervised
textutil fix(textutil): SSOT for rune-safe string truncation, fix 3 audit-gap bugs 2026-05-05 23:01:21 -07:00
ws
wsauth