Back to skill

Security audit

gsdata-search

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward GS Data search client, but it sends API signatures and search terms to a hardcoded plaintext HTTP endpoint.

Review this skill before installing. Use it only if you are comfortable sending the project ID, API signature, keywords, and time filters to the GS Data service, and avoid using sensitive credentials while the endpoint remains plaintext HTTP. Prefer a version that uses HTTPS, avoids passing secrets on the command line, and pins Python dependencies reproducibly.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
src/__init__.py:8
Finding
API Credentials Transmitted over Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `src/__init__.py`, lines 8 and 28–35 **Vulnerability Type**: Plaintext transmission of sensitive credentials **Risk Level**: High ### Vulnerable Code ```python API_URL = "http://projects-databus.gsdata.cn:7777/api-project/service" ``` ```python payload = { "project_id": project_id, "sign": sign, "router": ROUTER, "params": params_json, } resp = requests.post(API_URL, data=payload, timeout=30) ``` ### Technical Analysis The client submits the sensitive `sign` credential, the associated `project_id`, search terms, and other request parameters to an endpoint using unencrypted HTTP. HTTP does not provide transport confidentiality, server authentication, or message integrity. An attacker with visibility or control over the network path can read the request, capture the API credentials, alter request parameters, impersonate the remote API, or modify the response before it reaches the client. ### Attack Path 1. A user invokes the skill while connected through a network controlled or monitored by an attacker. 2. The client sends `project_id`, `sign`, and search parameters to the API over plaintext HTTP. 3. The attacker captures the request and extracts the credentials. 4. The attacker reuses the captured credentials to perform API operations permitted by that signature. 5. Alternatively, the attacker intercepts the response and injects misleading search-result fields that the client accepts and returns without transport-level integrity protection. ### Impact Assessment A successful attacker can obtain the API signature and any search data transmitted through the connection. The attacker may perform unauthorized API requests within the permissions and lifetime of the stolen credential. The attacker may also manipulate search requests or results. This issue does not directly grant privileges on the local host; its scope is limited to the compromised API credentials, API authorization scope, ...[truncated 45 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Replace the HTTP endpoint with an authenticated HTTPS endpoint. - Reject endpoint configuration that uses any scheme other than `https://`. - Keep TLS certificate verification enabled and do not introduce `verify=False`. - If the service is only available over HTTP, place it behind a properly configured TLS reverse proxy before using it for credentials. - Rotate all API signatures that may previously have been transmitted through this implementation. - Consider using short-lived, narrowly scoped credentials to reduce the impact of future disclosure. - Handle certificate and connection failures securely rather than falling back to plaintext HTTP. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
src/__init__.py:61
Finding
Sensitive API Signature Exposed through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `src/__init__.py`, lines 61–69 **Vulnerability Type**: Secret exposure through process arguments and shell history **Risk Level**: Medium ### Vulnerable Code ```python parser.add_argument("--project_id", required=True, help="项目 ID") parser.add_argument("--sign", required=True, help="签名") parser.add_argument("--keywords", required=True, help="搜索关键词") parser.add_argument("--posttime_start", required=True, help="开始时间") parser.add_argument("--posttime_end", required=True, help="结束时间") parser.add_argument("--limit", type=int, default=10, help="返回条数 (默认 10)") args = parser.parse_args() result = search(args.project_id, args.sign, args.keywords, args.posttime_start, args.posttime_end, args.limit) ``` ### Technical Analysis The command-line interface requires the API signature to be supplied through `--sign`. Command-line arguments can be retained in shell history, exposed in process listings, recorded by process-monitoring software, or included in automation and diagnostic logs. The exact visibility depends on the operating system and its process-access controls, but command-line parameters should not be treated as an appropriate secret-input channel. ### Attack Path 1. A user launches the client with `--sign <secret>`. 2. The shell may retain the complete invocation in its command history. 3. While the process is running, an authorized local observer or monitoring agent may inspect its command-line arguments. 4. An attacker with access to the history file, process metadata, job output, or monitoring logs extracts the signature. 5. The attacker reuses the signature for API requests within the credential's permitted scope. ### Impact Assessment The attacker can obtain the API signature and potentially impersonate the legitimate client when accessing the GS Data API. Resulting access is bounded by the signature's authorization scope and validity period. Exploitation generally requires local account access, a ...[truncated 191 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove the `--sign` command-line option as the primary secret-input mechanism. - Retrieve the signature from a secret manager or another protected credential store. - For interactive use, accept the signature through a non-echoing prompt such as Python's `getpass.getpass()`. - If environment variables are supported, document their local exposure limitations and avoid printing them in logs. - Ensure automation systems inject the credential through protected secret facilities rather than embedding it in command strings. - Redact the signature from application errors, telemetry, diagnostic output, and audit logs. - Rotate any signature known to have been retained in history or logs. ]]>

T08 · Insecure Dependencies

Warning
Location
package.json:8
Finding
Ambiguous and Insufficiently Constrained Dependency Declarations<![CDATA[ ## Vulnerability Details **File Locations**: `package.json` lines 8–10; `plugin.json` lines 10–12; `requirements.txt` line 1 **Vulnerability Type**: Cross-ecosystem dependency ambiguity and unpinned dependency resolution **Risk Level**: Medium ### Vulnerable Code `package.json`: ```json "dependencies": { "requests": "^2.31.0" } ``` `plugin.json`: ```json "dependencies": { "requests": "^2.31.0" } ``` `requirements.txt`: ```text requests>=2.25.1 ``` ### Technical Analysis The implementation imports the Python `requests` package, but the JSON manifests express the dependency using npm-style syntax. An installer that interprets `package.json` or `plugin.json` as JavaScript package metadata may resolve an npm package named `requests` rather than the required PyPI package. The Python requirement uses an open-ended lower bound and provides no lockfile or integrity hashes. Consequently, installation results can vary over time and may include future versions that were not reviewed with this project. The repository does not itself prove that a malicious dependency is currently installed. The security concern is that its declarations permit ambiguous ecosystem resolution and do not provide reproducible, integrity-checked Python dependency installation. ### Attack Path 1. A plugin or package installer reads an npm-style JSON dependency declaration. 2. The installer attempts to resolve `requests` from the npm ecosystem even though the runtime code expects the Python package. 3. Unintended package installation can introduce unrelated installation scripts or code into the environment, depending on installer behavior. 4. Separately, a Python installation resolves `requests>=2.25.1` to the newest matching release available at installation time. 5. A compromised, malicious, or incompatible future release could therefore be installed without a repository change or integrity verification. ### Impact Assessment The likely immediate impact is installation ...[truncated 471 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove npm-style `requests` declarations from `package.json` and `plugin.json` if the project is exclusively Python-based. - Declare the Python dependency only through Python packaging metadata and clearly document the supported installation process. - Pin `requests` and its transitive dependencies to versions tested with this project. - Use a lockfile or fully resolved requirements file with cryptographic hashes, such as installation with `pip --require-hashes`. - Review dependency updates before changing pinned versions. - Use automated vulnerability scanning for resolved Python dependencies. - Ensure the plugin installer does not interpret Python package names as npm dependencies. - If the hosting platform requires dependency metadata in `plugin.json`, use its documented Python-specific schema rather than npm version syntax. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (6)

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill documentation instructs users to provide a project_id, signature, and search parameters for an external API but does not clearly warn that these values will be transmitted off-system to projects-databus.gsdata.cn. This can lead users to disclose sensitive credentials or sensitive search terms without informed consent, which is especially relevant because API signatures are authentication material and search queries may contain proprietary or regulated data.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The client sends the project_id, signature, and search parameters to a hardcoded HTTP endpoint, which provides no transport-layer confidentiality or integrity. An attacker on the network path could intercept or modify the request or response, exposing credentials/signatures and search data or tampering with returned results.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"author": "Your Name",
  "license": "MIT",
  "dependencies": {
    "requests": "^2.31.0"
  }
}
Confidence
91% confidence
Finding
The dependency is specified with a caret range (^2.31.0), which allows automatic installation of newer minor/patch releases rather than a single exact version. This can introduce supply-chain risk through unexpected upstream changes or compromised releases, though the impact here is limited because it affects only one common dependency and there is no additional evidence of malicious package manipulation in this file.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.25.1
Confidence
96% confidence
Finding
The dependency is specified as `requests>=2.25.1`, which allows any newer version to be installed and does not guarantee reproducible or reviewed builds. This can unintentionally pull in vulnerable or breaking releases over time, making supply-chain risk harder to control and audit.

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
88% confidence
Finding
`requests` has multiple known advisories, and because the manifest does not pin the package version, it is not possible to verify whether the installed version is affected or safe. In security-sensitive agent skills, this uncertainty increases supply-chain exposure because deployments may resolve to different versions across environments.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
Natural-language strings such as the module docstring, function docstring, and CLI help are presented in Chinese, which can effectively force a specific language for users who invoke or read the tool. The file does not indicate that this is a region-specific tool or provide any opt-in or alternative language support.

Static analysis

No suspicious patterns detected.