Skip to content

Rule Reference

SEC635lintai-ai-securitystablehookdeny

Hook script: shell profile write

Hook script writes to a shell profile startup file

Provider
lintai-ai-security
Surface
hook
Scope
per_file
Tier
stable
Severity
deny
Confidence
high
Detection
structural
Remediation
message_only

Activation Model

Preset Membership

This rule is part of the builtin activation graph through these preset memberships.

Lifecycle

Stable Lifecycle Contract

State

stable_gated

Graduation rationale

Matches explicit shell startup profile modification in executable hook lines.

Deterministic signal basis

HookSignals redirection-or-tee detection over `.bashrc`, `.bash_profile`, `.zshrc`, or `.profile` targets in non-comment hook lines.

Malicious corpus
hook-persistence-escalation
Benign corpus
cursor-plugin-clean-basic
structured evidence required remediation reviewed
Canonical note

Structural stable rule intended as a high-precision check with deterministic evidence.

Nearby Signals

Related Rules

Why It Matters

Writing to .bashrc, .zshrc, .profile, or .bash_profile is a persistence mechanism. A hook that edits shell startup files can survive beyond the repository workflow and alter later shells.

What Triggers

SEC635 matches executable hook lines that write to shell startup files through redirection or tee, such as >> ~/.bashrc or tee -a ~/.zshrc.

False Positives

There are legitimate dotfile-management repos, but in a shared AI-executable hook this behavior still deserves review because it changes host startup state outside the project tree.

Remediation

Remove the startup-file write. Store state in a repo-local file or use an explicit installation step outside the hook if host shell configuration is truly required.