Back to skill

Security audit

Hair Diagnostics

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed hair-analysis helper that sends user-selected hair photos to YouCam APIs, with some scope-hardening issues but no evidence of deception or malicious behavior.

Install only if you are comfortable sending hair/selfie photos to YouCam/Perfect Corp and spending API credits after confirmation. Prefer setting YOUCAM_API_KEY as an environment variable instead of storing it in credentials.json, use trusted local image files where possible, and avoid using the generic helper arguments for non-hair or reference-image workflows.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (33)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
A shared runner that supports arbitrary YouCam features, multiple file types, reference images, or non-hair workflows creates a real least-privilege problem when this skill is advertised as a narrow hair-diagnostics tool. That gap can cause processing of unrelated sensitive images, accidental cross-domain use, and charges or outputs the user did not authorize.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
A shared runner that supports arbitrary YouCam features, multiple file types, reference images, or non-hair workflows creates a real least-privilege problem when this skill is advertised as a narrow hair-diagnostics tool. That gap can cause processing of unrelated sensitive images, accidental cross-domain use, and charges or outputs the user did not authorize.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
A shared runner that supports arbitrary YouCam features, multiple file types, reference images, or non-hair workflows creates a real least-privilege problem when this skill is advertised as a narrow hair-diagnostics tool. That gap can cause processing of unrelated sensitive images, accidental cross-domain use, and charges or outputs the user did not authorize.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
A shared runner that supports arbitrary YouCam features, multiple file types, reference images, or non-hair workflows creates a real least-privilege problem when this skill is advertised as a narrow hair-diagnostics tool. That gap can cause processing of unrelated sensitive images, accidental cross-domain use, and charges or outputs the user did not authorize.

Credential Access

High
Category
Privilege Escalation
Content
requirements:
  credentials:
    - name: YOUCAM_API_KEY
      source: env | credentials.json (in the skill root, next to SKILL.md)
  network:
    - yce-api-01.makeupar.com
  apis:
Confidence
87% confidence
Finding
Allowing API credentials to be sourced from a local `credentials.json` in the skill root increases the chance of accidental secret exposure through mispackaging, repository commits, local file leakage, or broader file-read access by the agent environment. In a skill that also has execution and network access, plaintext local secrets raise the blast radius if any adjacent component is compromised.

Credential Access

High
Category
Privilege Escalation
Content
requirements:
  credentials:
    - name: YOUCAM_API_KEY
      source: env | credentials.json (in the skill root, next to SKILL.md)
  network:
    - yce-api-01.makeupar.com
  apis:
Confidence
87% confidence
Finding
Allowing API credentials to be sourced from a local `credentials.json` in the skill root increases the chance of accidental secret exposure through mispackaging, repository commits, local file leakage, or broader file-read access by the agent environment. In a skill that also has execution and network access, plaintext local secrets raise the blast radius if any adjacent component is compromised.

Credential Access

High
Category
Privilege Escalation
Content
requirements:
  credentials:
    - name: YOUCAM_API_KEY
      source: env | credentials.json (in the skill root, next to SKILL.md)
  network:
    - yce-api-01.makeupar.com
  apis:
Confidence
87% confidence
Finding
Allowing API credentials to be sourced from a local `credentials.json` in the skill root increases the chance of accidental secret exposure through mispackaging, repository commits, local file leakage, or broader file-read access by the agent environment. In a skill that also has execution and network access, plaintext local secrets raise the blast radius if any adjacent component is compromised.

Credential Access

High
Category
Privilege Escalation
Content
requirements:
  credentials:
    - name: YOUCAM_API_KEY
      source: env | credentials.json (in the skill root, next to SKILL.md)
  network:
    - yce-api-01.makeupar.com
  apis:
Confidence
87% confidence
Finding
Allowing API credentials to be sourced from a local `credentials.json` in the skill root increases the chance of accidental secret exposure through mispackaging, repository commits, local file leakage, or broader file-read access by the agent environment. In a skill that also has execution and network access, plaintext local secrets raise the blast radius if any adjacent component is compromised.

Credential Access

High
Category
Privilege Escalation
Content
requirements:
  credentials:
    - name: YOUCAM_API_KEY
      source: env | credentials.json (in the skill root, next to SKILL.md)
  network:
    - yce-api-01.makeupar.com
  apis:
Confidence
87% confidence
Finding
Allowing API credentials to be sourced from a local `credentials.json` in the skill root increases the chance of accidental secret exposure through mispackaging, repository commits, local file leakage, or broader file-read access by the agent environment. In a skill that also has execution and network access, plaintext local secrets raise the blast radius if any adjacent component is compromised.

Credential Access

High
Category
Privilege Escalation
Content
requirements:
  credentials:
    - name: YOUCAM_API_KEY
      source: env | credentials.json (in the skill root, next to SKILL.md)
  network:
    - yce-api-01.makeupar.com
  apis:
Confidence
87% confidence
Finding
Allowing API credentials to be sourced from a local `credentials.json` in the skill root increases the chance of accidental secret exposure through mispackaging, repository commits, local file leakage, or broader file-read access by the agent environment. In a skill that also has execution and network access, plaintext local secrets raise the blast radius if any adjacent component is compromised.

Credential Access

High
Category
Privilege Escalation
Content
requirements:
  credentials:
    - name: YOUCAM_API_KEY
      source: env | credentials.json (in the skill root, next to SKILL.md)
  network:
    - yce-api-01.makeupar.com
  apis:
Confidence
87% confidence
Finding
Allowing API credentials to be sourced from a local `credentials.json` in the skill root increases the chance of accidental secret exposure through mispackaging, repository commits, local file leakage, or broader file-read access by the agent environment. In a skill that also has execution and network access, plaintext local secrets raise the blast radius if any adjacent component is compromised.

Credential Access

High
Category
Privilege Escalation
Content
requirements:
  credentials:
    - name: YOUCAM_API_KEY
      source: env | credentials.json (in the skill root, next to SKILL.md)
  network:
    - yce-api-01.makeupar.com
  apis:
Confidence
87% confidence
Finding
Allowing API credentials to be sourced from a local `credentials.json` in the skill root increases the chance of accidental secret exposure through mispackaging, repository commits, local file leakage, or broader file-read access by the agent environment. In a skill that also has execution and network access, plaintext local secrets raise the blast radius if any adjacent component is compromised.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
Each returns JSON (`data.results.hair_*{mapping, term}`). Interpret with `references/guide.md`
and assemble one report.

## Output rules
* For each selected metric, give the term + a plain-language note; end with an overall summary
  and gentle care directions.
* If a metric is missing in the response, skip it — do not fill it in.
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The CLI accepts an arbitrary --feature value for run, status, and cost operations, effectively exposing generic access to the broader YouCam API rather than only the declared hair-health diagnostics capability. In this skill context, that creates a scope-bypass where a user or downstream agent can invoke unrelated image-analysis functions, including potentially more sensitive face/skin features, using the same credentials and trust boundary.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The module exposes a generic task runner that accepts an arbitrary feature name, arbitrary params, optional reference inputs, and a reusable contract, allowing callers to invoke YouCam capabilities far outside the manifest's single-selfie hair diagnostics scope. In a skill environment, this creates a capability expansion path where the agent can be repurposed for unrelated image processing or transformation features without user expectation or policy review.

Context-Inappropriate Capability

High
Confidence
96% confidence
Finding
Supporting ref_file workflows enables transformation-style operations such as hair transfer or try-on that are explicitly outside the skill's stated purpose. In this context, reference-image support materially broadens the skill from passive diagnostics into multi-image manipulation pipelines, increasing the chance of unauthorized or misleading processing.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The top-level description says the skill diagnoses density, type, frizziness, and length from a single selfie. However, the usage instructions later state that type and frizziness require exactly three angle photos, so the advertised behavior does not match how the skill must actually be used.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The manifest says the skill diagnoses hair metrics from a single selfie, but the fallback API schema for hair type and frizziness explicitly requires three images from different angles. This mismatch can cause the agent to request additional images unexpectedly, fail at runtime, or mis-handle user data collection/consent by gathering more biometric images than the user was led to expect.

Intent-Code Divergence

Medium
Confidence
93% confidence
Finding
The module docstring explicitly presents this file as a shared CLI for every YouCam skill and includes examples for unrelated features such as skin-analysis. In a skill advertised as hair diagnostics only, this broadens operator expectations and enables repurposing the skill for out-of-scope biometric analysis, undermining policy and scope controls.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
print(f"[setup] virtual environment already exists at {_VENV_DIR}")
    else:
        print(f"[setup] creating virtual environment at {_VENV_DIR} ...")
        subprocess.run([sys.executable, "-m", "venv", _VENV_DIR], check=True)

    venv_python = _venv_python(_VENV_DIR)
    print(f"[setup] installing dependencies from {_REQUIREMENTS} ...")
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
venv_python = _venv_python(_VENV_DIR)
    print(f"[setup] installing dependencies from {_REQUIREMENTS} ...")
    subprocess.run([venv_python, "-m", "pip", "install", "--upgrade", "pip"], check=True)
    subprocess.run([venv_python, "-m", "pip", "install", "-r", _REQUIREMENTS], check=True)

    activate_hint = (
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
venv_python = _venv_python(_VENV_DIR)
    print(f"[setup] installing dependencies from {_REQUIREMENTS} ...")
    subprocess.run([venv_python, "-m", "pip", "install", "--upgrade", "pip"], check=True)
    subprocess.run([venv_python, "-m", "pip", "install", "-r", _REQUIREMENTS], check=True)

    activate_hint = (
        rf"{_VENV_DIR}\Scripts\activate" if os.name == "nt" else f"source {_VENV_DIR}/bin/activate"
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Intent-Code Divergence

Medium
Confidence
93% confidence
Finding
The file's documentation repeatedly presents the code as a generic wrapper for many YouCam features, including non-hair domains like skin analysis and clothes try-on. That active documentation conflicts with the skill manifest, which explicitly limits use to hair-health diagnostics and says not to use it for hairstyle/color try-on, skin, makeup, or clothes.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The code fetches arbitrary remote URLs server-side, then uploads the retrieved content onward, which introduces a network-fetch capability not justified by a single-selfie diagnostic skill. This can be abused for unreviewed third-party data ingestion, internal/metadata endpoint access depending on runtime network placement, and silent forwarding of fetched content to an external API.

Static analysis

No suspicious patterns detected.