Back to skill

Security audit

temporal-agent-plugin

Security checks for vulnerabilities and agentic risk

Overview

The main time-awareness code is mostly coherent, but the package also ships an undeclared archive-decoding utility that can write extracted files to disk unsafely.

Review this skill before installing. The temporal features are mostly aligned with the description, but remove or sandbox artifact/process_base64_zip.py before use, avoid running it on untrusted archives, and pin dependencies for reproducible installation.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
process_base64_zip.py:48
Finding

Unvalidated ZIP Extraction May Allow Writes Outside the Intended Directory

Content
View full analysis

Vulnerability Details

File Location: process_base64_zip.py:48-49
Vulnerability Type: Unvalidated archive extraction
Risk Level: High

Vulnerable Code

python
# 提取ZIP内容
print(f"提取ZIP内容到: {output_dir}")
with zipfile.ZipFile(zip_buffer, 'r') as zip_ref:
    zip_ref.extractall(output_dir)
    print(f"成功提取 {len(zip_ref.namelist())} 个文件")
    for file in zip_ref.namelist():
        print(f"  - {file}")

Technical Analysis

The function decodes externally supplied Base64 data and passes the resulting ZIP archive directly to ZipFile.extractall() without explicitly validating archive member paths.

Crafted archive entries may contain absolute paths, parent-directory components such as ../, or other unsafe path forms. If the runtime or extraction behavior does not adequately normalize these names, extraction can place files outside output_dir. The implementation also lacks checks for symbolic links, special files, duplicate entries, decompressed size, member count, and compression ratio.

Exploitation requires an attacker to control the Base64 archive and cause process_base64_zip() to process it. The utility is not exposed directly through the reviewed FastAPI endpoints, so the immediate attack surface is limited to local use or another integration that accepts attacker-controlled archives.

Attack Path

  1. The attacker creates a ZIP archive containing a malicious member name such as ../../application/config.py or another path targeting a writable file.
  2. The attacker Base64-encodes the archive.
  3. A user or integrating application passes the encoded file to process_base64_zip().
  4. The function decodes the archive and invokes zip_ref.extractall(output_dir) without performing its own containment validation.
  5. The malicious member is written outside the intended extraction directory if the active runtime permits the unsafe path.
  6. If a startup file, application module, conf ...[truncated 813 chars]
Remediation
View remediation

Remediation Suggestions

  • Resolve every archive member against the canonical extraction directory before writing it.
  • Reject absolute paths, drive-qualified paths, parent-directory traversal components, symbolic links, hard links, and special-device entries.
  • Extract validated members individually rather than calling extractall() on an untrusted archive.
  • Verify that each resolved destination remains beneath the canonical output directory using Path.resolve() and Path.relative_to().
  • Apply limits to the number of entries, total uncompressed size, per-file size, path length, and compression ratio to mitigate ZIP bombs.
  • Extract into a newly created directory with restrictive permissions.
  • Avoid running archive processing under an administrative account.

Example hardening pattern:

python
from pathlib import Path

destination = Path(output_dir).resolve()
destination.mkdir(parents=True, exist_ok=True)

with zipfile.ZipFile(zip_buffer, "r") as zip_ref:
    for member in zip_ref.infolist():
        member_path = destination.joinpath(member.filename).resolve()

        try:
            member_path.relative_to(destination)
        except ValueError:
            raise ValueError(f"Unsafe archive path: {member.filename}")

        if member.is_dir():
            member_path.mkdir(parents=True, exist_ok=True)
            continue

        member_path.parent.mkdir(parents=True, exist_ok=True)
        with zip_ref.open(member, "r") as source:
            with member_path.open("wb") as target:
                target.write(source.read())

This example should additionally be extended with symbolic-link detection and extraction-size limits before it is used with fully untrusted archives.

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unpinned Third-Party Dependencies Create a Mutable Supply-Chain Boundary

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:1-13; SKILL.md:45
Vulnerability Type: Unpinned and unhashed dependencies
Risk Level: Low

Vulnerable Code

requirements.txt contains only unversioned package names:

text
pandas
numpy
scikit-learn
pyarrow
fastapi
uvicorn
pytest
python-dateutil
scipy
matplotlib
pytz
geopy
psutil

The installation documentation also instructs users to install mutable package versions:

bash
pip install pandas numpy scikit-learn pyarrow fastapi uvicorn pytest python-dateutil scipy matplotlib pytz geopy

Technical Analysis

No dependency has an exact version constraint or an integrity hash. Consequently, two installations performed at different times can resolve to different artifacts even though the audited project files remain unchanged.

This does not demonstrate that any listed package is currently malicious. The weakness is that installation implicitly trusts whatever compatible release and transitive dependencies the configured package index serves at installation time. It also prevents reliable verification that users install the same artifacts that were tested or reviewed.

Because Python packages may run build-system or installation-related code and are imported by the application, a compromised upstream release, package-index account, build artifact, or transitive dependency could introduce unwanted behavior outside the reviewed source tree.

Attack Path

  1. A user follows SKILL.md or installs from requirements.txt.
  2. pip resolves the newest available compatible releases and their transitive dependencies.
  3. An upstream project, distribution artifact, maintainer account, or configured package index is compromised, or a future incompatible release is selected.
  4. The resolver downloads an artifact that was not part of the audited dependency set.
  5. Untrusted behavior may execute during package build, ...[truncated 600 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin every direct dependency to a reviewed exact version.
  • Generate and commit a lock file that also fixes transitive dependency versions.
  • Record cryptographic hashes and install with pip install --require-hashes.
  • Generate locked dependencies through a controlled process such as pip-tools.
  • Separate runtime dependencies from development and test packages such as pytest.
  • Use a trusted package index and explicitly configure approved index URLs in deployment environments.
  • Run dependency vulnerability and provenance checks in CI.
  • Regularly update pinned versions through reviewed dependency-update changes rather than resolving arbitrary latest releases during deployment.

A hardened deployment command should use a hash-locked file:

bash
python -m pip install --require-hashes -r requirements.lock
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (88)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about time perception and timing-related reasoning for AI agents, but the code is a utility for processing Base64-encoded ZIP data. Its primary behavior is file I/O, Base64 decoding, ZIP validation, archive extraction, and saving decoded binary output. These capabilities are materially different from temporal awareness, progress monitoring, or social timing understanding. This is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises substantial time-related functionality, but the provided code chunk does not implement any behavior at all. It is merely an empty module initialization file with a comment. This is a material mismatch because the actual code does not support the claimed primary purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises substantial time-perception functionality, but the provided code does not implement any behavior at all. This is a material mismatch in primary purpose: the code chunk is effectively empty and does not provide the described temporal awareness capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description claims substantive time-perception features, but the provided code chunk is just a minimal package initializer containing only a comment. There is no logic for timing prediction, progress monitoring, social timing, or any other operational capability. This is therefore a clear description-to-behavior mismatch based on the supplied code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code does include some timing-related behavior such as duration tracking, response-time anomaly detection, and progress stall checks, which partially overlaps with the description's mention of timing prediction/progress monitoring. However, its primary purpose is broader anomaly detection for tasks and system execution health, not 'temporal awareness' for AI agents or 'social timing understanding.' It also performs undeclared capabilities: inspecting CPU, memory, disk, and process RSS via psutil; detecting dependency deadlocks; and tracking external service failures. These are materially different from the declared purpose and imply system-monitoring behavior absent from the description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code is specifically a timeout prediction subsystem. It records observed execution durations, updates statistical/Bayesian models, predicts future timeout values, and exposes confidence and calibration stats. This partially overlaps with 'timing prediction,' but the declared description is much broader, claiming temporal awareness, progress monitoring, and social timing understanding. Those broader capabilities are not present in the code. The primary purpose is materially narrower than described, so this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The code is specifically a multi-agent time synchronization utility. It maintains per-agent offsets, converts between local and upstream timestamps, broadcasts timestamps across agents, checks drift thresholds, and reports session sync status. While this is related to temporal handling, it does not implement the broader capabilities claimed in the description—especially timing prediction, progress monitoring, or social timing understanding. The declared purpose therefore overstates and mischaracterizes the actual primary behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The code is narrowly focused on distributed clock synchronization between agents, not general time perception. It measures round-trip latency, computes clock offsets, tracks sync status, and provides consistent/master time views across agents. There is no implementation of timing prediction, progress monitoring, or social timing understanding. While clock synchronization is related to temporal handling, the declared description significantly overstates and mischaracterizes the module’s actual primary purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code clearly supports one subset of the description: progress monitoring and simple timing prediction for task completion. However, the declared purpose is substantially broader, claiming temporal awareness for AI agents and social timing understanding. The actual code only maintains per-task progress state, computes elapsed and remaining time from step completion rate, and exposes callbacks/history. There is no implementation of broader time perception, temporal reasoning, scheduling, or social timing behavior. Therefore the description overstates the skill's actual capabilities enough to count as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The code does include timing-related behavior such as prediction and progress-aware adjustment, so it partially aligns with the description. However, the declared purpose is broader and framed as general temporal awareness for AI agents, including social timing understanding. In reality, the implementation is specifically an execution-time timeout predictor/monitor for task types. It also accesses system resource information (CPU and memory via psutil), which is a meaningful undeclared capability/resource dependency. Most notably, there is no code related to social timing understanding or general time perception beyond timeout estimation. Therefore the description does not accurately represent the code's actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The code does provide temporal awareness features: current time retrieval, formatted time context, timezone support, relative time descriptions, and session-based synchronization/drift handling. However, the declared description overstates some areas not actually implemented, such as timing prediction, progress monitoring, and social timing understanding. More importantly for mismatch detection, the code also performs undeclared capabilities: it modifies prompts by injecting a time-anchor header and placeholders, and it initializes a geolocation service to resolve location-based timezone information, which implies external resource access not reflected in the declared permissions or description. These are material additional behaviors beyond a pure time-perception utility, so this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose presents this skill as a functional temporal-awareness component. However, the actual code shown is only a test harness for checking whether certain temporal-related modules can be imported successfully. It does not itself provide time perception, timing prediction, progress monitoring, or social timing behavior. While the tested module names are thematically related to the description, this specific code chunk’s primary purpose is dependency validation and diagnostics, which is materially different from the declared runtime capability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The code chunk is a standalone test/benchmark script for timeout prediction classes, not a general temporal-awareness skill. While there is partial overlap with 'timing prediction' via timeout estimation based on past durations, the broader declared scope—progress monitoring, social timing understanding, and AI time perception capabilities—is not evidenced here. The primary observed behavior is validating and benchmarking timeout predictors and a manager, which is materially narrower and more implementation/testing-focused than the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The supplied code chunk does deal with time-related functionality, but specifically as a standalone test harness for AgentTimeAnchor and ConversationTimeAnchorManager. It validates synchronization, drift detection, propagation, and conversion behavior. The declared description emphasizes broader temporal awareness capabilities such as timing prediction, progress monitoring, and social timing understanding, none of which are demonstrated here. While time synchronization is adjacent to 'time perception,' the actual code's primary purpose is testing infrastructure for conversation time anchors, so the description materially overstates and mischaracterizes what this chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description suggests a high-level cognitive time-perception skill for AI agents: predicting timing, monitoring progress, and understanding social timing. The supplied code does not implement those capabilities. Instead, it exercises a distributed systems clock synchronization module, focused on coordinating clocks between agents using different sync modes, batching, caching, priorities, adaptive intervals, and performance/statistics tests. While both relate loosely to 'time,' the actual primary purpose is system clock sync testing rather than temporal awareness or social/progress reasoning. This is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description emphasizes temporal awareness capabilities like timing prediction, progress monitoring, and social timing understanding. The supplied code does not implement or expose those behaviors; instead, it tests distributed clock synchronization mechanics between agents. While both relate loosely to time, the primary purpose is materially different: systems-level clock synchronization rather than cognitive or perceptual time-awareness features for an AI agent. No undeclared sensitive permissions are evident, but the functionality does not accurately match the stated description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The declared description presents a broad time-perception skill for AI agents, including predictive and social-timing capabilities. However, the supplied code only exercises and validates low-level time synchronization and prompt time-anchor injection behavior. It creates sessions, syncs timestamps, checks drift and session isolation, and verifies that a time header is inserted into prompts. There is no evidence of timing prediction, progress monitoring, or social timing understanding. The primary purpose of this code chunk is testing a time-anchor synchronization component, not delivering the broader temporal-awareness functionality described.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The code chunk does relate to temporal functionality, so it is not wholly unrelated. However, its primary purpose is not to provide general temporal awareness capabilities such as timing prediction, progress monitoring, or social timing understanding. Instead, it is a test script validating a specific time-anchor system and its session/time-sync features. It also demonstrates undeclared capabilities around session lifecycle management and prompt injection. Because the actual behavior is a verification harness for time anchoring and session synchronization rather than the broader declared agent-facing temporal-awareness skill, this is a meaningful description-behavior mismatch.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This file implements Base64 decoding and ZIP extraction, which is unrelated to the declared temporal-awareness purpose of the skill. Capability mismatch is dangerous because it can hide unexpected filesystem-affecting behavior inside a plugin users or orchestration systems would trust for a completely different function.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code extracts attacker-controlled archive contents to disk and also writes decoded raw bytes to an arbitrary output directory, neither of which is justified by the skill's stated purpose. In an agent/plugin context, unjustified file-write capabilities materially increase the risk of payload staging, persistence, or unauthorized modification of local files.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · process_base64_zip.py (reported line 72)May include surrounding context.

python
traceback.print_exc()

if __name__ == "__main__":
    base64_file = "C:\\Users\\Administrator\\Desktop\\trae-self-evolve-72h.zip"
    output_dir = "C:\\Users\\Administrator\\Desktop\\trae-self-evolve-72h"
    
    process_base64_zip(base64_file, output_dir)

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · process_base64_zip.py (reported line 73)May include surrounding context.

python
traceback.print_exc()

if __name__ == "__main__":
    base64_file = "C:\\Users\\Administrator\\Desktop\\trae-self-evolve-72h.zip"
    output_dir = "C:\\Users\\Administrator\\Desktop\\trae-self-evolve-72h"
    
    process_base64_zip(base64_file, output_dir)

Possible Typosquatting: 'uvicorn' resembles popular package 'gunicorn'

High
Category
Supply Chain
Confidence
70% confidence
Finding

Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

该文档从标题到全部说明均仅使用中文,未见提供多语言选项、用户选择机制或对语言限制的明确说明。根据规则,若技能在自然语言层面强制特定语言而未取得用户选择/同意,可构成语言或地区政策问题。

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · README.md (reported line 151)May include surrounding context.

python src/api/endpoints.py

调用API

curl -X POST http://localhost:8000/api/duration/predict
-H "Content-Type: application/json"
-d '{"task_type": "analysis", "complexity": 2.0}'

text