Back to skill

Security audit

Xiaojia Skills

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it says, but it sends API keys and user content to a user-configured network endpoint without destination validation and documents a mutable install path.

Install only if you trust the publisher and the JustAI endpoint you configure. Use an HTTPS JustAI URL you control or have verified, protect and rotate the API key like a password, avoid sending secrets or regulated data unless the remote service is approved for it, and prefer installing from a pinned commit or signed release rather than the mutable README command.

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

Warning
Location
scripts/_common.py:20
Finding

Unrestricted API Base URL Can Expose Bearer Credentials and Sensitive Request Data

Content
View full analysis

Vulnerability Details

File Location: scripts/_common.py, lines 20-43 and 59-76
Vulnerability Type: Unvalidated network destination and insecure credential transmission
Risk Level: Medium

Vulnerable Code

python
def get_base_url() -> str:
    return require_env("JUSTAI_OPENAPI_BASE_URL").rstrip("/")


def get_api_key() -> str:
    return require_env("JUSTAI_OPENAPI_API_KEY")


def build_request(path: str, payload: dict, api_key: str) -> urllib.request.Request:
    return urllib.request.Request(
        url=f"{get_base_url()}{path}",
        data=json.dumps(payload, ensure_ascii=False).encode("utf-8"),
        headers={
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json",
        },
        method="POST",
    )


def open_json(request: urllib.request.Request, timeout: int) -> dict:
    try:
        with urllib.request.urlopen(request, timeout=timeout) as response:
            body = response.read().decode("utf-8")
python
def submit_chat(
    message: str,
    conversation_id: str = "",
    timeout: int = DEFAULT_TIMEOUT,
    project_ids: list[str] | None = None,
    skill_ids: list[str] | None = None,
) -> dict:
    api_key = get_api_key()
    submit_payload = {"message": message}
    if conversation_id:
        submit_payload["conversation_id"] = conversation_id
    if project_ids:
        submit_payload["project_id"] = [item for item in project_ids if item]
    if skill_ids:
        submit_payload["skill_id"] = [item for item in skill_ids if item]

    submit_request = build_request("/openapi/agent/chat_submit", submit_payload, api_key)
    return open_json(submit_request, timeout=timeout)

Technical Analysis

The base URL is taken directly from the JUSTAI_OPENAPI_BASE_URL environment variable without validating its scheme, hostname, port, or origin. The request builder then sends the `J ...[truncated 2035 chars]

Remediation
View remediation

Remediation Suggestions

  1. Parse the configured URL with urllib.parse.urlsplit and reject malformed values.
  2. Require the https scheme in normal operation. Permit plaintext HTTP only through an explicit development-only option that never uses production credentials.
  3. Maintain an explicit allowlist of approved JustAI hostnames and ports.
  4. Reject URLs containing embedded credentials, fragments, unexpected paths, or unapproved ports.
  5. Implement a redirect handler that blocks redirects or only permits same-origin HTTPS redirects.
  6. Bind API keys to the narrowest possible server-side permissions, tenant, source network, and expiration period.
  7. Clearly document that messages and identifiers are transmitted to the configured remote service.
  8. Add automated tests confirming that HTTP URLs, foreign hosts, cross-origin redirects, and malformed URLs are rejected before the authorization header is sent.

T08 · Insecure Dependencies

Warning
Location
README.md:19
Finding

Unpinned npx Installer and Mutable Repository Reference Create Supply-Chain Risk

Content
View full analysis

Vulnerability Details

File Location: README.md, lines 19-23
Vulnerability Type: Unpinned installation dependencies and mutable source reference
Risk Level: Medium

Vulnerable Code

markdown
Recommended direct installation with `npx skills add`:

```bash
npx skills add https://github.com/qinshimeng18/xiaojia-skills --skill xiaojia-skills
text

### Technical Analysis

The documented installation command invokes `npx` without pinning the resolved npm package to a reviewed version. It also installs the Skill from a GitHub repository without selecting an immutable commit hash or signed release tag.

This means the components retrieved when a user follows the installation instructions can differ from the code that was audited. A compromised npm package, compromised repository, account takeover, force-pushed tag, or later malicious update could introduce arbitrary scripts or Skill instructions.

This audit did not find a remote payload retrieval mechanism in the bundled runtime scripts. The risk arises specifically from the documented installation process and its mutable third-party sources.

### Attack Path

1. An attacker compromises the npm package resolved by `npx`, the GitHub repository, or an account authorized to publish changes.
2. The attacker publishes a modified installer or repository revision containing malicious code or Skill instructions.
3. A user runs the documented unpinned command.
4. `npx` resolves the current package version, and the installer retrieves the current repository contents rather than the audited revision.
5. The malicious content is executed during installation or installed into the user's Agent Skill directory.
6. Subsequent Skill invocations execute the substituted scripts with the permissions available to the Agent environment.

### Impact Assessment

Impact depends on the permissions of the user or Agent running the installer. A malicious installer or substitu
...[truncated 403 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the npm package invoked by npx to a specific reviewed version.
  2. Reference the Skill repository by an immutable commit hash rather than the default branch.
  3. Prefer signed, immutable releases published from a verified organizational repository.
  4. Publish SHA-256 checksums or cryptographic signatures for release artifacts and verify them before installation.
  5. Use lockfiles and integrity metadata where supported by the installation tooling.
  6. Run installation with the minimum required operating-system privileges and avoid elevated or administrator accounts.
  7. Document the exact installer version and repository commit corresponding to each audited release.
  8. Add release automation that prevents tags from being moved and verifies package provenance.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This code does not implement the declared async chat behavior. Its sole function is to request and display the projects/folders accessible to the API key. That is a materially different primary purpose and accesses a different resource than the declared /openapi/agent/chat_submit and /openapi/agent/chat_result endpoints. Therefore the description does not accurately represent the actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill should call JustAI async chat endpoints to drive deployed agent interactions and return structured chat results. The supplied code does something materially different: it is a command-line utility for enumerating available skills accessible to the current API key. Its primary endpoint, inputs, and outputs are all inconsistent with the declared purpose. This is a clear description-behavior mismatch, not merely an implementation detail variation.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
97% confidence
Finding

This skill has direct network capability and can send data to a URL controlled by the JUSTAI_OPENAPI_BASE_URL environment variable, yet that capability is not covered by declared permissions. In a skill ecosystem, undeclared network egress is dangerous because it can transmit prompts, conversation IDs, or derived sensitive data to external services without clear platform oversight.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
97% confidence
Finding

This skill has direct network capability and can send data to a URL controlled by the JUSTAI_OPENAPI_BASE_URL environment variable, yet that capability is not covered by declared permissions. In a skill ecosystem, undeclared network egress is dangerous because it can transmit prompts, conversation IDs, or derived sensitive data to external services without clear platform oversight.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README states that the skill sends prompts to a remote JustAI OpenAPI agent instead of reasoning locally, but it does not prominently warn users that conversation contents may leave the local environment and be processed by a third-party service. In a skill context, users may paste sensitive business, customer, or credential-adjacent data, so lack of an explicit privacy/data-transmission warning can lead to unintended data exposure.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README instructs users to set JUSTAI_OPENAPI_API_KEY but provides no warning about protecting the credential from shell history leaks, accidental commits, screenshots, logs, or reuse in untrusted environments. In a skill ecosystem where users may copy-paste setup commands, omission of basic secret-handling guidance increases the chance of credential compromise and unauthorized API use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to send user messages and optional project/skill context to remote JustAI OpenAPI endpoints, but it does not explicitly warn that this content leaves the local environment and may include sensitive data from selected project folders. In an agent setting, this can cause unintentional external disclosure of user prompts, identifiers, or proprietary project context without informed user consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The submit_chat function forwards raw user-provided message content to remote endpoints, but this file contains no disclosure, consent mechanism, or data-minimization controls. Given the skill’s purpose is to proxy user requests to an external JustAI service, this means potentially sensitive user content is transmitted off-box, increasing privacy and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The get_api_key function reads JUSTAI_OPENAPI_API_KEY from the environment, which is sensitive credential access. This file does not include any comment, docstring, or user-facing notice explaining that an API key is required and used for outbound authentication.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.