Skip to content

fix: remediate 13 reachable security findings (cmdi, SSRF, PII, secret, error-leak, vuln-dep)#19

Draft
al1dazzi with Copilot wants to merge 4 commits into
mainfrom
copilot/rch-task-32b212b142b1986e-remediate-batch
Draft

fix: remediate 13 reachable security findings (cmdi, SSRF, PII, secret, error-leak, vuln-dep)#19
al1dazzi with Copilot wants to merge 4 commits into
mainfrom
copilot/rch-task-32b212b142b1986e-remediate-batch

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown

Addresses a batch of 13 production-actionable security findings across the handler layer, spanning command injection, SSRF, PII leakage, hardcoded secrets, error disclosure, and a vulnerable dependency.

Command Injection (CWE-78) — cwe.go

  • DiagnosticPing: replaced exec.Command("sh", "-c", "ping -c 1 "+host) with host validation + fixed-argv exec.Command("ping", "-c", "1", host)
  • Both ping handlers now log command failures server-side and return a generic client message instead of raw command output

SSRF + Cleartext (CWE-918/319) — suspicious.go

  • FetchTool: validates https-only scheme; replaces http.Get with a custom http.Client using ssrfSafeDial — a dialer that validates resolved IPs against private CIDR ranges at TCP connect time, eliminating the DNS TOCTOU/rebinding gap
var safeFetchClient = &http.Client{
    Transport: &http.Transport{DialContext: ssrfSafeDial},
}
// ssrfSafeDial resolves the hostname, checks each IP against privateNets,
// then dials — no window between check and connect.

LLM Prompt Injection (AI) — ai.go

  • AIAnswer / AIAgentPlan: user-controlled content moved to a dedicated "role": "user" message instead of being concatenated into the system instruction string; raw prompt/tool-spec no longer echoed in the response

PII Leakage (DLP) — dlp.go

  • SupportExport: SSN and DOB replaced with [REDACTED] in both the server log and the analytics POST payload

Hardcoded Secret — secrets.go

  • Removed const syntheticGitHubToken = "ghp_reachtestbedsynthetic000000000000000000"
  • CloudTokens reads GITHUB_TOKEN from the environment; returns "configured" or "" — never the token value itself

Error Disclosure (CWE-200) — ai.go, cve.go, suspicious.go

  • SafeAIAnswer, ParseLanguage, and FetchTool error paths replaced err.Error() responses with generic client-safe messages; detail logged server-side

Vulnerable Dependency (CVE)

  • golang.org/x/text bumped v0.3.7 → v0.3.8

Copilot AI changed the title [WIP] Remediate selected batch of 13 units from Reachable task fix: remediate 13 reachable security findings (cmdi, SSRF, PII, secret, error-leak, vuln-dep) Jun 22, 2026
Copilot AI requested a review from al1dazzi June 22, 2026 00:12
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.

2 participants