Skip to content

fix: neutralize untrusted workspace strings and redact credential secrets - #4

Merged
jwmoss merged 1 commit into
mainfrom
fix/harden-untrusted-output
Sep 12, 2026
Merged

jwmoss merged 1 commit into
mainfrom
fix/harden-untrusted-output

Conversation

@jwmoss

@jwmoss jwmoss commented Sep 12, 2026

Copy link
Copy Markdown
Member

Summary

Follow-ups from the 1.0.3 Go code security audit. No findings were critical or high; these close the medium and low items that are cheap and self-contained.

  • progress() sanitizes every argument with terminalText at the sink, so a warehouse or service principal named with escape sequences cannot rewrite the operator's terminal.
  • terminalText also escapes Unicode format characters (bidi overrides, isolates) and U+2028/2029.
  • auth status table cells go through terminalText.
  • writeComments in the HCL renderer, the only path that bypasses hclwrite, strips line breaks.
  • Storage credential inventory drops client_secret and secret_access_key before serialization. UC redacts these today; DataTF no longer relies on that.
  • Grant pagination stops with an issue after 1000 pages or a repeated page token instead of looping until OOM.
  • workspace_error and render_error join the telemetry error-code allowlist, with a test that every CLI code round-trips.

Test plan

  • make check (golden files unchanged)
  • New tests: terminalText, progress sink, redaction, telemetry code round-trip

@jwmoss
jwmoss force-pushed the fix/harden-untrusted-output branch from e86eb51 to bd74570 Compare September 12, 2026 01:12
…rets

Sanitize progress lines, the auth status table, and HCL comment text;
extend terminalText to format and line separator characters; redact
storage credential secret fields from inventory output; cap grant
pagination; and allowlist the workspace_error and render_error
telemetry categories.
@jwmoss
jwmoss force-pushed the fix/harden-untrusted-output branch from bd74570 to 3fb2079 Compare September 12, 2026 01:12
@jwmoss
jwmoss merged commit 80508fd into main Sep 12, 2026
2 checks passed
@jwmoss
jwmoss deleted the fix/harden-untrusted-output branch September 12, 2026 01:14
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.

1 participant