T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:6- Finding
ERP records are created without restrictive access permissions
- Content
View full analysis
Vulnerability Details
File Location:
scripts/script.sh, lines 6-8; representative record write at lines 151-155
Vulnerability Type: Plaintext sensitive-data exposure through insecure filesystem permissions
Risk Level: MediumVulnerable Code
bash DATA_DIR="${HOME}/.local/share/erp" mkdir -p "$DATA_DIR" _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }Representative data write:
bash echo "$ts|$input" >> "$DATA_DIR/add.log" local total=$(wc -l < "$DATA_DIR/add.log") echo " [Erp] add: $input" echo " Saved. Total add entries: $total" _log "add" "$input"Technical Analysis
The application stores ERP records and generated exports under
~/.local/share/erpbut does not establish a restrictiveumaskor explicitly assign secure modes to the directory and files. Consequently, access permissions are inherited from the invoking process.With a permissive environment configuration, the directory or files may be readable by other local users. The stored content may include inventory information, supplier details, employee reviews, resource plans, reminders, KPIs, and other confidential business records. The same weakness applies to
history.log, command-specific logs, and generated export files.Symbolic-link protections are also absent. If an attacker can manipulate the data-directory contents under the affected account, output redirection follows existing symbolic links.
Attack Path
- A user runs the Skill in an environment with a permissive
umask. - The script creates
~/.local/share/erpand its files without explicitly restrictive permissions. - The user records confidential operational or business information.
- Another local account enumerates and reads accessible files such as
history.log,plan.log,review.log, orexport.csv. - The attacker obtains the ERP records available under the inherited filesystem permissi ...[truncated 603 chars]
- A user runs the Skill in an environment with a permissive
- Remediation
View remediation
Remediation Suggestions
-
Set a restrictive process mask before creating or writing any records:
bash umask 077 -
Create the data directory with an explicit owner-only mode:
bash install -d -m 700 -- "$DATA_DIR" -
Ensure existing log and export files are restricted to mode
0600. -
Before writing, verify that destination files are regular files owned by the current user and are not symbolic links.
-
Where supported, use no-follow and atomic file-creation mechanisms rather than ordinary shell redirection.
-
Document that the files contain plaintext business data and should not be used for secrets unless encryption and suitable access controls are added.
-
