Back to skill

Security audit

Reconcile Timeline

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent video-timeline purpose, but its script can overwrite selected job data unsafely and uses predictable files in the job folder.

Review before installing. Use this only on trusted job folders and keep a backup of input.json before running it. Do not run it with elevated privileges or against shared/untrusted directories until the temp-file handling and validation-before-replace behavior are fixed.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/reconcile.sh:39
Finding

Predictable Temporary Files Allow Symlink-Based File Overwrite

Content
View full analysis
"$JOB/reconcile.jq" ([.subtitles[].words[]]) as $W | def toks(s): (s | gsub("[[:space:]]+"; " ") | ltrimstr(" ") | rtrimstr(" ") | if . == "" then [] else split(" ") end); (.timeline | length) as $T | [ range(0; $T) as $i | { cursor: 0, timeline: .timeline, words: $W, ok: true, failidx: null } | reduce range(0; $T) as $j (.; (.timeline[$j].vo_line) as $vl | (toks($vl) | length) as $n | if (.cursor + $n) > (.words | length) then .ok = false | .failidx = $j else (.words[.cursor]) as $first | (.words[.cursor + $n - 1]) as $last | .timeline[$j].start_time = $first.start | .timeline[$j].end_time = $last.end | .cursor = (.cursor + $n) end ) ] | last | if (.ok | not) then error("RECONCILE_OVERRUN at segment \(.failidx): vo_line word count exceeds remaining measured words") else { timeline: .timeline, audio_duration: .timeline[-1].end_time } end JQEOF OUT=$(mktemp) jq -f "$JOB/reconcile.jq" "$INPUT" > "$OUT" 2> "$JOB/.reconcile.err" ``` ### Technical Analysis The script creates `reconcile.jq` and `.reconcile.err` at predictable paths inside the caller-selected job directory. Shell output redirection follows symbolic links, and the script does not verify that either destination is a regular file owned by the expected user. Consequently, if an attacker can prepare or modify the job directory, they can create either predictable path as a symbolic link to another file. The redirections will then truncate or overwrite the linked target with the privileges of the account running the skill. The use of `mktemp` for `OUT` does not protect the two files written directly under `$JOB`. In addition, `reconcile.jq` is not remov ...[truncated 1263 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/reconcile.sh:90
Finding

Input File Is Replaced Before Reconciled Timeline Validation

Content
View full analysis
"$MERGED" mv "$MERGED" "$INPUT" rm -f "$OUT" BAD=$(jq -r ' [ range(0; (.timeline|length)) as $i | .timeline[$i] as $s | select(($s.end_time < $s.start_time) or ($i > 0 and ($s.start_time < .timeline[$i-1].end_time - 0.001))) | $i ] | if length>0 then (map(tostring)|join(", ")) else "" end ' "$INPUT") if [ -n "$BAD" ]; then echo "FAILED: post-reconcile timeline has non-monotonic segments at: $BAD" >&2 exit 1 fi ``` ### Technical Analysis The script moves the newly merged document over the original `input.json` before checking whether the reconciled timeline is monotonic. The validation therefore detects invalid output only after the original state has already been destroyed. If measured subtitle timings produce an end time earlier than a start time, or cause one segment to overlap a previous segment beyond the accepted tolerance, the script reports failure but leaves the invalid document in place. No backup or rollback mechanism restores the original input. This violates transactional update principles: all validation should be performed on the candidate output before an atomic replacement of authoritative data. ### Attack Path 1. An attacker or faulty upstream process supplies a syntactically valid `input.json` with schema version `3.0-long`, populated subtitle words, and timeline narration satisfying the preliminary count checks. 2. The measured word timing values are arranged so the generated timeline contains reversed or non-monotonic boundaries. 3. The script creates the merged candidate and immediately executes: ```bash mv "$MERGED ...[truncated 746 chars]
Remediation
View remediation
&2 exit 1 fi mv -- "$MERGED" "$INPUT" ``` - Validate that all timing values are finite JSON numbers, non-negative, ordered, and within the measured audio duration. - Preserve the original file's permissions and ownership when appropriate. - Consider creating a backup before replacement or using a rollback strategy if later operations can still fail. - Install an exit trap that removes candidate files without altering the authoritative input when validation fails. ]]>
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/reconcile.sh (reported line 76)May include surrounding context.

sh
rm -f "$OUT"
  exit 1
fi
rm -f "$JOB/.reconcile.err"

# 6. Safety check
VO_TOKENS=$(jq '[.timeline[].vo_line | gsub("[[:space:]]+";" ") | ltrimstr(" ") | rtrimstr(" ") | if .=="" then [] else split(" ") end | length] | add' "$INPUT")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This shell script performs an in-place replacement of the user-supplied job folder's input.json via mv "$MERGED" "$INPUT". Although the script logs success afterward, there is no prior user-facing warning, confirmation, or comment/docstring disclosing that the original file will be modified in place, which is a safety-relevant file write operation.

Content

No source excerpt is available for this finding.