Back to skill

Security audit

qshare

Security checks for vulnerabilities and agentic risk

Overview

The skill is a public file-sharing tool, but it needs review because its tunnel mode can expose more than the selected file and its CNB upload path uses an embedded shared bearer token with broad remote asset authority.

Review before installing. Use CNB only for files you are comfortable making public and encrypt sensitive files first. Avoid the --cf tunnel mode until the server is fixed to serve only the selected file, because recipients may be able to access other files in the same folder. The publisher should rotate/remove the embedded CNB token and replace it with scoped, short-lived upload/delete authority.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
src/qshare/cli.py:252
Finding

TryCloudflare Share Exposes the Selected File's Entire Parent Directory

Content
View full analysis

Vulnerability Details

File Location: src/qshare/cli.py:252-271, 297-305
Vulnerability Type: Improper file-scope restriction and unintended directory exposure
Risk Level: High

Vulnerable Code

python
class ShareHandler(SimpleHTTPRequestHandler):
    def __init__(self, *args: object, **kwargs: object) -> None:
        # ``directory=`` was added to SimpleHTTPRequestHandler in Python 3.7.
        # Store it ourselves so Python 3.6 can serve the selected file's
        # parent directory without changing the process working directory.
        self._share_directory = kwargs.pop("directory", os.getcwd())
        super().__init__(*args, **kwargs)

    def log_message(self, format: str, *args: object) -> None:  # noqa: A003
        return

    def translate_path(self, path: str) -> str:
        """Resolve request paths below the configured share directory."""
        path = posixpath.normpath(unquote(urlparse(path).path))
        words = [word for word in path.split("/") if word]
        translated = str(self._share_directory)
        for word in words:
            if os.path.dirname(word) or word in (os.curdir, os.pardir):
                continue
            translated = os.path.join(translated, word)
        return translated
python
def start_local_http_server(file_path: Path, port: int) -> Tuple[ShareHTTPServer, threading.Thread]:
    if not file_path.exists():
        raise FileNotFoundError(f"File does not exist: {file_path}")
    if not file_path.is_file():
        raise ValueError(f"Path is not a file: {file_path}")

    server = ShareHTTPServer(("127.0.0.1", port), partial(ShareHandler, directory=str(file_path.parent)))
    thread = threading.Thread(target=server.serve_forever, name="qshare-http", daemon=True)
    thread.start()
    return server, thread

Technical Analysis

The Skill promises to share one specifically selected local file. However ...[truncated 2199 chars]

Remediation
View remediation

Remediation Suggestions

Replace the directory-oriented handler with a strict single-file handler:

  1. Store the selected file's resolved absolute path and expected URL path in the handler.
  2. Accept only an exact, safely encoded match for the selected filename.
  3. Return 404 Not Found for /, sibling filenames, subdirectories, alternate encodings, and all other paths.
  4. Disable inherited directory-listing behavior by overriding list_directory() to reject requests.
  5. Avoid mapping arbitrary request paths onto file_path.parent.
  6. Resolve and compare filesystem paths before opening the file to prevent normalization or symlink-related scope expansion.
  7. Add regression tests proving that the selected file returns success while /, sibling files, encoded path variants, and subdirectories return 404.

T09 · Insecure Skill Coding Practices

Error
Location
src/qshare/cnb.py:12
Finding

Hardcoded CNB Repository Bearer Token Is Distributed to Every Package Consumer

Content
View full analysis

Vulnerability Details

File Location: src/qshare/cnb.py:12-29, 38-49, 114-130
Vulnerability Type: Hardcoded authentication credential
Risk Level: High

Vulnerable Code

python
TOKEN = "67emzlY14b8RDEHMJmuevI6GuON"
REPO = "steinveni/qshare"
API = "https://api.cnb.cool/{}".format(REPO)
ACCEPT = "application/vnd.cnb.api+json"
CHUNK_SIZE = 1024 * 1024


def request_json(url, method="GET", payload=None):
    headers = {"Accept": ACCEPT, "Authorization": "Bearer " + TOKEN}
    data = None
    if payload is not None:
        headers["Content-Type"] = "application/json"
        data = json.dumps(payload).encode("utf-8")
    request = Request(url, data=data, headers=headers, method=method)
    try:
        with urlopen(request, timeout=120) as response:
            body = response.read()
        return json.loads(body.decode("utf-8")) if body else {}

The credential is used for release creation:

python
def get_or_create_release(tag):
    releases = request_json(API + "/-/releases")
    for release in releases:
        if release.get("tag_name") == tag:
            return str(release["id"])
    release = request_json(
        API + "/-/releases",
        method="POST",
        payload={
            "tag_name": tag,
            "name": tag,
            "body": "Release " + tag,
            "target_commitish": "main",
        },
    )
    return str(release["id"])

It is also used for asset deletion:

python
def delete_cnb_assets(tag, name):
    """Delete every server-side copy of an asset from its release."""
    deleted = 0
    for release in request_json(API + "/-/releases"):
        if release.get("tag_name") != tag:
            continue
        release_id = release.get("id")
        if release_id is None:
            continue
        for asset in release.get("assets", []):
            if asset.get("name") != name:
         
...[truncated 2467 chars]
Remediation
View remediation

Remediation Suggestions

  1. Immediately revoke and rotate the exposed bearer token.
  2. Remove the token from source code, package artifacts, documentation, and repository history where practicable.
  3. Do not replace it with an environment variable containing another shared repository-wide credential on end-user machines; package consumers could still recover it at runtime.
  4. Move privileged repository operations to a trusted server-side broker.
  5. Have the broker issue narrowly scoped, short-lived, single-upload credentials after applying authentication, authorization, rate limits, file-size limits, and abuse controls.
  6. Bind deletion authority to the uploader or return a one-time deletion capability rather than exposing repository-wide deletion privileges.
  7. Apply least-privilege permissions so an upload credential cannot create arbitrary releases or delete unrelated assets.
  8. Add secret-scanning checks to CI and prevent builds or releases when credential patterns are detected.
  9. Review CNB audit records for unauthorized release creation, uploads, or deletions performed with the exposed token.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A hardcoded CNB bearer token, use of a specific third-party repository/account, and retention behavior inconsistent with the declared 3-day policy indicate undisclosed remote control over where files are uploaded and how they are handled. This can expose user files to unauthorized access, covert exfiltration, deceptive retention/deletion semantics, and abuse of embedded credentials.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A hardcoded CNB bearer token, use of a specific third-party repository/account, and retention behavior inconsistent with the declared 3-day policy indicate undisclosed remote control over where files are uploaded and how they are handled. This can expose user files to unauthorized access, covert exfiltration, deceptive retention/deletion semantics, and abuse of embedded credentials.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · src/qshare/cli.py (reported line 650)May include surrounding context.

python
def start_background_process(argv: List[str]) -> int:
    cmd = [sys.executable, "-m", "qshare"] + argv
    env = os.environ.copy()
    env["QSHARE_BACKGROUND_CHILD"] = "1"
    kwargs = {
        "stdin": subprocess.DEVNULL,

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

A hardcoded bearer token is embedded directly in source and automatically used for outbound requests. Anyone with access to the code can extract and reuse the credential to interact with the CNB repository API, potentially uploading, enumerating, or deleting release assets under that account.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: py (CVE-2022-42969 (ReDoS))

High
Category
Supply Chain
Confidence
70% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: pytest==6.2.5 — 2 advisory(ies): CVE-2025-71176 (pytest has vulnerable tmpdir handling); CVE-2025-71176 (pytest has vulnerable tmpdir handling)

High
Category
Supply Chain
Confidence
80% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: pytest==7.4.4 — 2 advisory(ies): CVE-2025-71176 (pytest has vulnerable tmpdir handling); CVE-2025-71176 (pytest has vulnerable tmpdir handling)

High
Category
Supply Chain
Confidence
80% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: pytest==8.3.5 — 2 advisory(ies): CVE-2025-71176 (pytest has vulnerable tmpdir handling); CVE-2025-71176 (pytest has vulnerable tmpdir handling)

High
Category
Supply Chain
Confidence
80% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: pytest==8.4.2 — 2 advisory(ies): CVE-2025-71176 (pytest has vulnerable tmpdir handling); CVE-2025-71176 (pytest has vulnerable tmpdir handling)

High
Category
Supply Chain
Confidence
80% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: zipp==3.6.0 — 2 advisory(ies): CVE-2024-5569 (zipp Denial of Service vulnerability); CVE-2024-5569 (zipp Denial of Service vulnerability)

High
Category
Supply Chain
Confidence
80% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: zipp==3.15.0 — 2 advisory(ies): CVE-2024-5569 (zipp Denial of Service vulnerability); CVE-2024-5569 (zipp Denial of Service vulnerability)

High
Category
Supply Chain
Confidence
80% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares no explicit tool scope even though it instructs use of shell, network, file access, and potentially environment-dependent behavior. Missing permission boundaries increases the chance an agent can invoke broader capabilities than users expect, especially for a skill that uploads local files to public endpoints.

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/build_platform_wheels.py (reported line 51)May include surrounding context.

python
unpack_dir = Path(tempfile.mkdtemp(prefix="qshare-wheel-"))
    try:
        wheel_command = [sys.executable, "-m", "wheel"]
        subprocess.run(
            wheel_command + ["unpack", str(base_wheel), "--dest", str(unpack_dir)], check=True
        )
        package_dir = next(unpack_dir.iterdir())

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/build_platform_wheels.py (reported line 66)May include surrounding context.

python
binary_target = package_dir / "qshare" / "_binaries" / filename
        binary_target.parent.mkdir(parents=True, exist_ok=True)
        shutil.copyfile(str(binary), str(binary_target))
        subprocess.run(
            wheel_command + ["pack", str(package_dir), "--dest-dir", str(dist_dir)], check=True
        )
        expected = dist_dir / (base_wheel.stem.replace("py3-none-any", "py3-none-{}".format(tag)) + ".whl")

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 · src/qshare/cli.py (reported line 382)May include surrounding context.

python
| getattr(subprocess, "CREATE_NEW_PROCESS_GROUP", 0)
                | getattr(subprocess, "DETACHED_PROCESS", 0)
            )
        process = subprocess.Popen(
            [cloudflared_path, "tunnel", "--url", local_url, "--no-autoupdate", "--logfile", str(logfile)],
            **kwargs,
        )

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 · src/qshare/cli.py (reported line 666)May include surrounding context.

python
kwargs["creationflags"] = creationflags
    else:
        kwargs["start_new_session"] = True
    subprocess.Popen(cmd, **kwargs)
    print("qshare started in background.")
    return 0

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest says the skill shares via CNB uploads by default, with TryCloudflare as an optional mode. However, main() routes to run_cnb_upload only when --cf is not set, while build_parser advertises both modes; more importantly, this file's core share workflow and top-level execution path are centered on run_share(), which launches a local HTTP server and a TryCloudflare tunnel, creating a mismatch with the claimed default behavior and user-facing description.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module-level documentation describes only uploading a file as a CNB release asset. However, the same module also implements delete_cnb_assets(), which performs remote deletion of matching assets from the repository. This is an active contradiction in stated intent versus implemented behavior, not just an omitted detail.

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 · src/qshare/cnb.py (reported line 14)May include surrounding context.

python
TOKEN = "67emzlY14b8RDEHMJmuevI6GuON"
REPO = "steinveni/qshare"
API = "https://api.cnb.cool/{}".format(REPO)
ACCEPT = "application/vnd.cnb.api+json"
CHUNK_SIZE = 1024 * 1024

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 · src/qshare/cnb.py (reported line 100)May include surrounding context.

python
TOKEN = "67emzlY14b8RDEHMJmuevI6GuON"
REPO = "steinveni/qshare"
API = "https://api.cnb.cool/{}".format(REPO)
ACCEPT = "application/vnd.cnb.api+json"
CHUNK_SIZE = 1024 * 1024

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 · tests/test_qshare.py (reported line 456)May include surrounding context.

python
TOKEN = "67emzlY14b8RDEHMJmuevI6GuON"
REPO = "steinveni/qshare"
API = "https://api.cnb.cool/{}".format(REPO)
ACCEPT = "application/vnd.cnb.api+json"
CHUNK_SIZE = 1024 * 1024

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 · tests/test_qshare.py (reported line 457)May include surrounding context.

python
TOKEN = "67emzlY14b8RDEHMJmuevI6GuON"
REPO = "steinveni/qshare"
API = "https://api.cnb.cool/{}".format(REPO)
ACCEPT = "application/vnd.cnb.api+json"
CHUNK_SIZE = 1024 * 1024

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code can delete remote release assets matching a name without any confirmation prompt, dry-run mode, or user-facing warning. In a file-sharing skill, silent destructive operations increase the risk of accidental or unauthorized data loss, especially because the same embedded token appears to authorize repository-wide asset operations.

Content

No source excerpt is available for this finding.

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · tests/test_qshare.py (reported line 70)May include surrounding context.

python
client.close()
        time.sleep(0.1)

        with urllib.request.urlopen("http://127.0.0.1:{}/large-file.bin".format(port)) as response:
            assert response.read() == file_path.read_bytes()
        assert thread.is_alive()
    finally:

Unverifiable Dependency: setuptools has 10 known advisory(ies) (CVE-2013-1633 (Setuptools vulnerable to Man-in-the-middle attacks); CVE-2025-47273 (setuptools has a path traversal vulnerability in PackageIndex.download that lead); CVE-2024-6345 (setuptools vulnerable to Command Injection via package URL) +7 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.