Back to skill

Security audit

diffraction-scatter

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to be a coherent pyFAI diffraction/scattering helper, with expected local data processing and installation behavior but some scoping and output-format caveats users should notice.

Before installing, be aware that the helper may install Python packages into a local virtual environment. Use the default pyFAI-related packages or trusted package names only, avoid running it with administrator privileges, and expect the skill to read user-selected diffraction data and write derived outputs to the chosen output directory.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:256
Finding

Mandatory Agent Response Manipulation Through Skill Instructions

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
lib/install_env.py:32
Finding

Unrestricted Third-Party Package Installation Through User-Controlled Extras

Content
View full analysis
=2024.1", "fabio>=2024.1", "h5py>=3.7", "numpy>=1.22"], help="Packages to install", ) # ... packages = [str(pkg) for pkg in args.extras] _run( [str(venv_python), "-m", "pip", "install", "--upgrade", "pip", "setuptools", "wheel"], args.dry_run, ) _run([str(venv_python), "-m", "pip", "install", *packages], args.dry_run) ``` The command runner executes the generated argument list directly: ```python def _run(command: list[str], dry_run: bool) -> None: print(json.dumps({"event": "command", "argv": command}, ensure_ascii=False), flush=True) if dry_run: return subprocess.run(command, check=True) ``` ### Technical Analysis The `--extras` option accepts arbitrary package specifications and forwards them to pip without an allowlist, exact version pins, hash validation, or a reviewed lockfile. Although `subprocess.run` correctly uses an argument list and does not enable a shell, this does not mitigate package-level code execution. Pip can install packages from package indexes, direct URLs, version-control references, archives, or local paths. Package build backends and installation processes may execute package-controlled Python code with the privileges of the user running the installer. Broad lower-bound constraints in the defaults also permit future, unreviewed package versions to be selected. An attacker who can influence the arguments supplied by an agent, automation system, or wrapper can provide a malicious or dependency-confusion package through `--extras`. A typographical error can produce a similar result through typosquatting. ### Attack Path 1. The installation helper is invoked directly or through an agent-generated command. ...[truncated 1352 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (10)

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill instructs execution of local Python scripts, shell commands, file inspection, and writing outputs, but declares no explicit tool scope or permission boundaries. In an agent environment, this can lead to overbroad file access and shell execution beyond user expectations, increasing the chance of unintended command execution or unsafe handling of local data.

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 · lib/install_env.py (reported line 23)May include surrounding context.

python
print(json.dumps({"event": "command", "argv": command}, ensure_ascii=False), flush=True)
    if dry_run:
        return
    subprocess.run(command, check=True)


def main() -> int:

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This markdown file defines activation conditions, so vague-trigger checks apply. The phrase 'Installing or using pyFAI' is broad and lacks boundaries or exclusion conditions, which may cause the skill to activate for generic pyFAI questions not specifically tied to diffraction/scattering data processing workflows.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Lines L038-L039 state the skill is for work only after the user already has a .poni geometry file. However, lines L050-L075 explicitly direct the skill to handle missing .poni cases by guiding installation and calibration, which contradicts the earlier scope statement rather than merely adding detail.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The activation examples '1D integration' and 'GIWAXS, sector, cake, HDF5, Eiger' are short keyword-style triggers without context or negative examples. In a markdown skill description, such broad terms can overlap with unrelated discussions and make it unclear when the skill should activate versus when it should not.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The top-level docstring presents the skill description in English and Chinese, indicating a fixed language choice embedded in the file rather than a user-selectable locale. Under the stated policy, forcing a specific language or locale without opt-in can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation states that this quick start applies only when the user already has a .poni file and is not doing calibration. The manifest, however, explicitly says calibration is part of the full workflow and that having a .poni file is not a prerequisite for using the skill, so these lines actively narrow the stated intent in a contradictory way.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This Python file contains natural-language documentation in both English and Chinese, including a non-default locale string, but does not indicate that language selection is optional or justified by a region-specific requirement. Under the policy rule for language or locale constraints, this can be treated as a potential locale-policy issue because the file embeds multilingual guidance without clarifying user opt-in or scope.

Content

No source excerpt is available for this finding.