Skip to content

fix: harden command execution, history permissions, and key entry - #104

Merged
NeckBeardPrince merged 3 commits into
mainfrom
fix/security-review-findings
Jun 9, 2026
Merged

fix: harden command execution, history permissions, and key entry#104
NeckBeardPrince merged 3 commits into
mainfrom
fix/security-review-findings

Conversation

@NeckBeardPrince

Copy link
Copy Markdown
Owner

Addresses five findings from a security review:

  • TUI -x path executed a re-queried AI response instead of the one the
    user saw and approved, and skipped the dangerous-command warning.
    Store the displayed Response on the model and execute exactly that,
    with the isDangerous warning applied. Clear it on errors so a stale
    command can never run on exit.
  • The fork-bomb pattern contained unescaped regex metacharacters, so it
    parsed as alternation and missed whitespace variants. Escaped and made
    whitespace-tolerant.
  • Broadened dangerous patterns: rm -fr flag order, bare ~ target,
    pipe-to-shell (curl | sh), and chmod 777 /.
  • History file now created 0600 (was 0644) and legacy files tightened on
    next write; state directory now 0700, matching config-file treatment.
  • First-run API key entry no longer echoes to the terminal
    (golang.org/x/term ReadPassword), keeping keys out of scrollback and
    session recordings.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com## Description

NeckBeardPrince and others added 2 commits June 9, 2026 15:43
Addresses five findings from a security review:

- TUI -x path executed a *re-queried* AI response instead of the one the
  user saw and approved, and skipped the dangerous-command warning.
  Store the displayed Response on the model and execute exactly that,
  with the isDangerous warning applied. Clear it on errors so a stale
  command can never run on exit.
- The fork-bomb pattern contained unescaped regex metacharacters, so it
  parsed as alternation and missed whitespace variants. Escaped and made
  whitespace-tolerant.
- Broadened dangerous patterns: rm -fr flag order, bare ~ target,
  pipe-to-shell (curl | sh), and chmod 777 /.
- History file now created 0600 (was 0644) and legacy files tightened on
  next write; state directory now 0700, matching config-file treatment.
- First-run API key entry no longer echoes to the terminal
  (golang.org/x/term ReadPassword), keeping keys out of scrollback and
  session recordings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@NeckBeardPrince NeckBeardPrince self-assigned this Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 2 package(s) with unknown licenses.
See the Details below.

License Issues

go.mod

PackageVersionLicenseIssue Type
golang.org/x/sys0.46.0NullUnknown License
golang.org/x/term0.44.0NullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
gomod/golang.org/x/sys 0.46.0 UnknownUnknown
gomod/golang.org/x/term 0.44.0 UnknownUnknown

Scanned Files

  • go.mod

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@NeckBeardPrince
NeckBeardPrince merged commit b02c148 into main Jun 9, 2026
6 checks passed
@NeckBeardPrince
NeckBeardPrince deleted the fix/security-review-findings branch June 9, 2026 20:52
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