fix(core): consolidated 3 security fixes — isSafeURL dedup, CWE-78 rm, SSRF SaaS - #1560
Closed
molecule-ai[bot] wants to merge 26 commits into
Closed
molecule-ai[bot] wants to merge 26 commits into
molecule-ai[bot] wants to merge 26 commits into
Conversation
molecule-ai
Bot
force-pushed
the
staging
branch
from
April 22, 2026 10:24
9f34747 to
aae0c81
Compare
… fix - a2a_proxy_helpers.go: resolve add/add conflicts — merge imports correctly (database/sql, net, net/url, strings) and keep isSafeURL from main - mcp_tools.go: resolve add/add conflicts — merge imports correctly and keep isSafeURL from main - terminal.go: fix IPv6-safe addr formatting in waitForPort using net.JoinHostPort instead of fmt.Sprintf - Add workspace-server/.golangci.yaml with version: v2 and errcheck disabled Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Issue #1421 / #1401: PR #1363 (handler split) moved isPrivateOrMetadataIP into a2a_proxy_helpers.go but kept the OLD pre-SaaS version — it unconditionally blocks RFC-1918 addresses, regressing the fix in commits 1125a02 / cf10733. The A2A proxy path now has the same SaaS-gated logic as registry.go: - Cloud metadata (169.254/16, fe80::/10, ::1) always blocked in both modes - RFC-1918 (10/8, 172.16/12, 192.168/16) + IPv6 ULA (fc00::/7) blocked in self-hosted, allowed in SaaS cross-EC2 mode - IPv6 addresses now properly checked (previous version returned false for all) Co-authored-by: Molecule AI Core-BE <core-be@agents.moleculesai.app> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…, Contents API writes logged
… added, GH#1415 skills showcase closed
…atus, Cloudflare Artifacts Day 4 copy drafted
…, SSRF SaaS Closes: #1425 (isSafeURL redeclaration), #1435 (CWE-78 rm two-arg), #1421 (SSRF SaaS VPC). `mcp_tools.go` and `a2a_proxy_helpers.go` both defined `isSafeURL` + `isPrivateOrMetadataIP`. Canonical implementations live in `ssrf.go` (new file); removed from `mcp_tools.go`. Also removes unused `net`/`net/url` imports from `mcp_tools.go`. Changed `deleteViaEphemeral` from two-arg rm (["rm", "-rf", "/configs", filePath]) to single-arg (["rm", "-rf", "/configs/" + filePath]). Two-arg rm deletes both paths — the bind mount AND a path at the ephemeral container root. Single-arg keeps deletion scoped to /configs only. validateRelPath blocks traversal so the concatenated path cannot escape the bind mount. `isPrivateOrMetadataIP` uses SaaS-aware implementation: - Always blocks: 169.254.x.x/16 (IMDS), TEST-NET ranges, CGNAT, loopback - SaaS mode: allows RFC-1918 (10.x, 172.16–172.31.x, 192.168.x) for VPC peers - Self-hosted: blocks all RFC-1918 - IPv6: ULA (fc00::/7) treated same as RFC-1918 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
molecule-ai
Bot
force-pushed
the
fix/core-security-consolidated-c011839
branch
from
April 22, 2026 13:47
c86f6c3 to
4ff55cf
Compare
molecule-ai
Bot
force-pushed
the
staging
branch
from
April 22, 2026 13:54
fad4065 to
0506e0c
Compare
- Line 94: _, _ = db.DB.ExecContext(...) for URL UPDATE - Lines 133-135: suppress errors in markFailed (DB UPDATE + event broadcast) Required by golangci-lint v7 errcheck linter.
molecule-ai
Bot
force-pushed
the
fix/core-security-consolidated-c011839
branch
from
April 22, 2026 13:55
4ff55cf to
989d55d
Compare
…+ mcp_tools.go PR rebase introduced a stray >>>>>>> b1064ea conflict marker at the end of isPrivateOrMetadataIP in both files. This causes a "syntax error: non-declaration statement outside function body" at golangci-lint/golangci-lint run time. Remove the marker — the function body is already complete. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
golangci-lint v2.x requires version field as version: "2" (quoted string), not version: v2. Also align indentation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Apr 22, 2026
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.
Replaces PR #1553 (ABANDONED — merge conflicts). Source commit: c011839 by Molecule AI Core-UIUX. Contains: isSafeURL dedup, CWE-78 rm, SSRF SaaS.