Back to skill

Security audit

YouCam Hair Color & Style Advisor

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its hairstyle-preview purpose, with ordinary precautions needed for sharing selfies, protecting the API key, and installing dependencies.

Use photos you are comfortable sending to Perfect Corp/YouCam and review its privacy and retention terms before analysis or generation. Approve the selected operations and credit costs, protect your API key, and use trusted image URLs. Prefer reviewed, locked dependency versions. All bundled files were reviewed; live service behavior and resolved dependency versions were not verified.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
Findings (27)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The code's operational scope is broader than the declared skill purpose. Its run, status, and templates commands forward caller-selected feature names to shared API modules without enforcing the description's exclusions. The supplied examples explicitly include skin analysis, which the description excludes. Actual feature availability depends on contracts and imported modules not supplied here, but this chunk clearly implements a general YouCam interface rather than a hair-only workflow. Dependency setup, authentication, and account queries are supporting implementation details and are not independently treated as mismatches.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The run() function passes the caller-supplied feature to contract loading, task creation, and polling without a hairstyle/hair-color allowlist. Its documentation explicitly describes skin-analysis and garment-reference workflows, which exceed the declared scope. File uploads, URL downloads, temporary files, and polling are ordinary supporting implementation details and are not independently treated as mismatches. The supplied chunk does not implement face-shape or skin-tone-based recommendations, though that logic could exist elsewhere.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 12)May include surrounding context.

md
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:

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 53)May include surrounding context.

md
1. A clear, **front-facing** selfie that shows the hair.
2. Run `python scripts/youcam_core.py validate-key` (0 credits) to confirm the key. If it is not set,
   tell the user to get one at <https://yce.perfectcorp.com/api-console> and set the
   `YOUCAM_API_KEY` env var, or create `credentials.json` in the skill root (see
   `credentials.example.json` for the format).

## Flow

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/constants.py (reported line 23)May include surrounding context.

python
SKILL_SCRIPT_ROOT = os.path.dirname(os.path.abspath(__file__))
API_FALLBACK_DOC = os.path.join(SKILL_SCRIPT_ROOT, "api-fallback.yaml")
CREDENTIALS_FILE = os.path.join(os.path.dirname(SKILL_SCRIPT_ROOT), "credentials.json")

# Install dependencies into a local virtual environment in the skill script folder.
VENV_DIR = os.path.join(SKILL_SCRIPT_ROOT, ".venv")

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · SKILL.md (reported line 83)May include surrounding context.

md
using the `task_id` from that output, until `task_status` is `success` or `error`. A task_id
   stays valid for 24 hours.

## Output rules
* **Return the result image URL exactly as given** (hyperlink is OK; do not modify it).
* Explain the recommendation (face shape → style, skin tone → color).
* **Always end with this note:** "This preview image is AI-generated and for reference only;

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/constants.py (reported line 7)May include surrounding context.

python
skills/<skill-name>/
  ├── SKILL.md
  ├── credentials.example.json   # template for credentials.json
  ├── credentials.json           # CREDENTIALS_FILE (user-provided)
  └── scripts/                   # SKILL_SCRIPT_ROOT (this file's folder)
      ├── constants.py, youcam_api.py, ...

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/constants.py (reported line 8)May include surrounding context.

python
skills/<skill-name>/
  ├── SKILL.md
  ├── credentials.example.json   # template for credentials.json
  ├── credentials.json           # CREDENTIALS_FILE (user-provided)
  └── scripts/                   # SKILL_SCRIPT_ROOT (this file's folder)
      ├── constants.py, youcam_api.py, ...
      ├── api-fallback.yaml      # API_FALLBACK_DOC

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/constants.py (reported line 15)May include surrounding context.

python
├── requirements.txt       # REQUIREMENTS_FILE
      └── .venv/                 # VENV_DIR

Every path the scripts use resolves inside `SKILL_SCRIPT_ROOT`, except credentials.json, which lives
one level up in the skill root so users edit it next to SKILL.md rather than inside the vendored code.
"""

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/youcam_api.py (reported line 90)May include surrounding context.

python
def get_key() -> str:
    """Resolve the API key from the YOUCAM_API_KEY env var or credentials.json.

    Exits with code 2 and a structured error if no usable key is configured.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/youcam_api.py (reported line 108)May include surrounding context.

python
"No API key configured.",
            hint=f'Set the YOUCAM_API_KEY env var, or create {CREDENTIALS_FILE} with {{"api_key": "..."}}'
            + format_hint,
            details="Neither YOUCAM_API_KEY nor credentials.json was found.",
            code=2,
        )

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/youcam_core.py (reported line 9)May include surrounding context.

python
everything the skill needs.

Auth:
    Set the YOUCAM_API_KEY environment variable, or create a credentials.json file (in the
    skill's root, next to SKILL.md) containing {"api_key": "..."}. The env var is used first
    if both are present. If neither is set, the command & API call fails.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/youcam_tasks.py (reported line 123)May include surrounding context.

python
try-on. Follows the same rules as src_file. Not every feature needs this.
        params: Extra options to send along with the request.
        key: The API key to use. Required; the caller (e.g. youcam_core.py's CLI) is
            expected to resolve it from YOUCAM_API_KEY or credentials.json beforehand.
        version: Which version of the feature to call. Defaults to the standard version.
        interval: How many seconds to wait between checks while the job is processing.
        max_polls: How many times to check on the job before giving up and returning

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/youcam_tasks.py (reported line 141)May include surrounding context.

python
contract = contract or load_contract(feature)
    if not key:
        raise ValueError(
            "missing API key. set the YOUCAM_API_KEY env var, or create credentials.json "
            "(see credentials.example.json for the format)"
        )
    body = dict(params or {})

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

The workflow sends personal photos to a third-party API without explicitly warning the user about that transfer.

Medium
Category
Output Handling
Confidence
96% confidence
Finding

The workflow processes identifiable selfies through a third-party service without explicitly explaining that the photos leave the user's environment. Naming YouCam and requesting approval for credit costs provide some context, but do not clearly establish informed consent for external photo processing, especially for analysis performed before generation.

Content

No source excerpt is available for this finding.

Tainted flow: 'put_req' from requests.post (line 295, network input) → requests.put (network output)

Medium
Category
Data Flow
Confidence
82% confidence
Finding

The upload response controls the PUT destination without HTTPS, host, or network-address validation, and the request sends the selected local file there. Presigned uploads are legitimate, but a compromised or misconfigured metadata service could redirect sensitive portrait bytes to an attacker or issue requests into the client's private network; the API bearer token is not explicitly forwarded by this PUT.

Content

Scanner excerpt · scripts/youcam_api.py (reported line 297)May include surrounding context.

python
info = meta.json()["data"]["files"][0]
    put_req = info["requests"][0]
    with open(file_path, "rb") as fh:
        requests.put(
            put_req["url"],
            headers=put_req.get("headers", {"Content-Type": ct}),
            data=fh,

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/youcam_api.py (reported line 313)May include surrounding context.

python
Args:
        contract: The feature's loaded API contract, e.g. from load_contract().
        feature: Which YouCam feature to create a task for, e.g. "skin-analysis".
        body: The request payload, e.g. file_id(s)/url(s) and any feature-specific params.
        key: The API key to authenticate the request with.
        version: Which version of the feature to call. Defaults to the standard version.

The CLI dispatches non-hair YouCam features despite the manifest's explicit hair-only scope.

Medium
Category
Excessive Agency
Confidence
94% confidence
Finding

The run command loads a contract for the caller-supplied feature and forwards it to the task runner without enforcing the skill's hairstyle/hair-color scope. This is a shared, general-purpose interface whose documented examples explicitly include skin analysis (L017-L021), a capability the manifest excludes, potentially enabling out-of-scope image processing and API-credit consumption.

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 · scripts/youcam_init.py (reported line 49)May include surrounding context.

python
def _run_setup_step(cmd: list[str]) -> None:
    """Run one setup command, exiting with a structured error if it fails."""
    try:
        subprocess.run(cmd, check=True)
    except subprocess.CalledProcessError as exc:
        exit_with_error(
            "setup_failed",

The task runner supports unrestricted YouCam features, including categories explicitly excluded by the hair-advisor manifest.

Medium
Category
Excessive Agency
Confidence
95% confidence
Finding

run() loads a contract for the caller-supplied feature and passes that feature to task creation and polling without restricting it to hairstyle or hair-color previews. This broader capability is explicitly documented with skin-analysis (L112) and garment try-on (L118–L120, L153), although the manifest excludes skin and clothing functionality.

Content

No source excerpt is available for this finding.

The mandatory API-spec retrieval accesses docs.perfectcorp.com, outside the declared network scope.

Low
Category
Excessive Agency
Confidence
97% confidence
Finding

The workflow requires fetching documentation from docs.perfectcorp.com, but its network declaration lists only yce-api-01.makeupar.com. This is a network-scope inconsistency that can cause denied requests or undeclared outbound access if the declaration is only advisory; the vendor-documentation purpose limits the likely impact.

Content

No source excerpt is available for this finding.

The mandatory closing disclaimer forces English output without a language choice.

Low
Category
Output Handling
Confidence
91% confidence
Finding

The instruction requires every response to end with a fixed English disclaimer, including responses to users communicating in another language. It provides no option to translate the note or follow the user's preferred language, and no locale-specific justification.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The open-ended requests requirement makes installations nonreproducible and allows unreviewed releases without artifact integrity checks. This is a supply-chain hardening weakness, not evidence that a malicious or vulnerable release is currently installed.

Content

Scanner excerpt · scripts/requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.28
PyYAML>=6.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
86% confidence
Finding

The requests>=2.28 constraint admits older releases affected by subsequent security advisories, including the cited 2024 and 2025 issues. This confirms an insufficient dependency constraint, but neither an affected installed version nor an exploitable application path is established.

Content

No source excerpt is available for this finding.