Back to skill

Security audit

Earnings Call Processor

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated purpose, but its default shared temporary output folder can retain or expose full earnings-call content and may be vulnerable to local tampering.

Review before installing if you process non-public calls or work on shared machines. Use a private, user-owned output directory instead of /tmp/earnings_output, inspect the generated Feishu content before publishing, and delete transcripts and summaries when no longer needed.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
src/process_earnings_call.py:38
Finding

Predictable Shared Temporary Directory Enables File Manipulation

Content
View full analysis

Vulnerability Details

File Location: src/process_earnings_call.py, lines 38–47 and 245–276
Vulnerability Type: Unsafe temporary-file and output-path handling
Risk Level: Medium

Vulnerable Code

python
# Whisper writes <basename>.txt next to the audio or in output_dir
audio_stem = Path(audio_path).stem
transcript_file = out_path / f"{audio_stem}.txt"
if not transcript_file.exists():
    # fallback: look for any .txt in output_dir
    txts = list(out_path.glob("*.txt"))
    if txts:
        transcript_file = txts[0]
    else:
        raise FileNotFoundError(f"No transcript file found in {out_path}")

transcript = transcript_file.read_text(encoding="utf-8").strip()
# also save a canonical copy
canonical = out_path / "transcript.txt"
canonical.write_text(transcript, encoding="utf-8")
python
parser.add_argument("--output-dir", default="/tmp/earnings_output", help="Output directory")
args = parser.parse_args()

output_dir = Path(args.output_dir)
output_dir.mkdir(parents=True, exist_ok=True)
python
indicators_path = output_dir / "financial_indicators.json"
indicators_path.write_text(
    json.dumps(indicators, indent=2, ensure_ascii=False),
    encoding="utf-8"
)

feishu_path = output_dir / "feishu_content.md"
feishu_path.write_text(feishu_md, encoding="utf-8")

Technical Analysis

The application uses the fixed, predictable path /tmp/earnings_output as its default output directory. It does not verify that this directory is owned by the current user, has restrictive permissions, or is not controlled by another local account. It also writes predictable filenames without rejecting symbolic links or confirming that their destinations are regular files.

The transcript fallback compounds this weakness. If Whisper does not create the exact expected transcript filename, the application selects the first existing *.txt entry in the output directory without proving that Whisper created it during the current run. An at ...[truncated 1890 chars]

Remediation
View remediation

Remediation Suggestions

  1. When no output directory is supplied, create a unique private directory with tempfile.mkdtemp() or tempfile.TemporaryDirectory() rather than using a fixed shared path.
  2. Create directories with permissions restricted to the current user, such as mode 0700, and verify ownership and permissions before use.
  3. Remove the unrestricted glob("*.txt") fallback. Accept only the exact transcript path expected for the current audio file and invocation.
  4. Record directory contents before invoking Whisper and only accept an output created by that invocation if fallback discovery is unavoidable.
  5. Reject symbolic links and non-regular files before reading or writing. Use lstat() or equivalent checks and validate the resolved destination remains inside the intended output directory.
  6. Create output files securely and exclusively using low-level flags such as O_CREAT | O_EXCL | O_NOFOLLOW where supported.
  7. Write to securely created temporary files in the same trusted directory, flush them, and atomically replace final outputs after validating the destination.
  8. Fail safely if the selected output directory already exists with unexpected ownership, permissions, or contents.
Vulnerability Patterns
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (5)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill invokes local Python scripts, reads input files, writes output files, and instructs use of another script via shell command, but it declares no explicit tool scope or permissions. That mismatch weakens policy enforcement and reviewability: an agent may execute broader file and shell operations than a consumer of the skill metadata expects, increasing the chance of unsafe file access, command execution, or misuse through parameter injection in downstream tooling.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · src/process_earnings_call.py (reported line 31)May include surrounding context.

python
"--output_dir", str(out_path),
    ]
    print(f"[whisper] Running: {' '.join(cmd)}")
    result = subprocess.run(cmd, capture_output=True, text=True)
    if result.returncode != 0:
        print(f"[whisper] stderr: {result.stderr}", file=sys.stderr)
        raise RuntimeError(f"Whisper failed with exit code {result.returncode}")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code writes the full transcript and a canonical copy to disk automatically, which can persist sensitive financial discussions, names, or material nonpublic information longer than the user expects. In a skill that processes earnings-call audio, silent local retention increases confidentiality and compliance risk, especially on shared hosts or developer workstations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The generated document, summaries, and labels are all hard-coded in Chinese, which forces a specific language/locale regardless of user preference. There is no opt-in, language selection parameter, or justification that this skill is intended only for a Chinese-language environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The pipeline persists derived financial indicators and a Feishu-formatted markdown summary without warning, creating additional copies of potentially sensitive source content and analysis. Because the generated markdown embeds transcript content, this broadens the data footprint and raises the chance of unintended disclosure through local files, backups, or shared temporary storage.

Content

No source excerpt is available for this finding.