T09 · Insecure Skill Coding Practices
- Location
scripts/init_session.py:62- Finding
Dianxiaobao Credential Exposure Through the Session Initialization Command Line
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its Amazon draft-listing purpose, but it includes unnecessary command-line paths that can expose a store credential.
Review this skill before installing if you are uncomfortable giving it Dianxiaobao, AlphaShop, and 1688 image-gateway credentials or sending product images and listing data to those services. Prefer the documented session-based commands, avoid any direct encryptedCode command-line usage, protect the local .env and /tmp session files, and rotate credentials if they may have been exposed in shell history or logs.
scripts/init_session.py:62Dianxiaobao Credential Exposure Through the Session Initialization Command Line
scripts/map_amazon_attrs.py:461Legacy Amazon Attribute CLI Mode Exposes Dianxiaobao Credential in Process Arguments
The declared description promises a substantial workflow for converting 1688 products into Amazon draft listings for 店小宝. However, the provided code chunk is only an empty package initializer with a descriptive docstring and does not implement any of the stated capabilities. Based on the supplied code alone, the actual behavior is effectively non-functional metadata, which is materially different from the declared purpose.
The declared description describes a full Amazon listing-draft workflow for 1688 products, but the supplied code chunk only selects and launches a Python 3 interpreter. While environment checking is mentioned in the description, this code does not implement the advertised business functionality and instead serves as a generic runtime bootstrapper. Therefore the code chunk does not accurately represent the declared purpose.
Referenced artifact was not completely inspected
bash scripts/run_python.sh scripts/process_images.py <session_dir>
Referenced artifact was not completely inspected
bash scripts/run_python.sh scripts/process_images.py <session_dir>
Referenced artifact was not completely inspected
bash scripts/run_python.sh scripts/process_images.py <session_dir>
Referenced artifact was not completely inspected
bash scripts/run_python.sh scripts/process_images.py <session_dir>
Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.
"串珠链": "Beaded Chain",
"Fashion": "fashion",
"Fine": "fine",
"No Warning Applicable": "no_warning_applicable",
}
if value in replacements:
return replacements[value]
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def load_env() -> None:
env_path = Path(__file__).resolve().parent.parent / ".env"
if not env_path.exists():
return
for raw_line in env_path.read_text().splitlines():
The skill instructs execution of multiple shell/Python scripts, uses environment variables containing access keys, reads and writes session files, and clearly implies network/API access, yet it declares no explicit tool/permission scope. Without least-privilege restrictions, an agent may grant broader shell, file, and network access than necessary, increasing the blast radius if the skill or any referenced script is compromised or behaves unexpectedly.
Line L51 states that image processing may append translate_to_en when a category or platform requires language handling. This imposes a specific language transformation in natural language instructions without indicating user choice, opt-in, or a clearly documented regional/compliance justification.
The build function unconditionally assigns a marketplace and language tag from defaults or environment variables when none are provided. This creates a locale policy risk because output language/marketplace behavior is fixed implicitly rather than chosen by the user or clearly limited to a justified region-specific context.
The module docstring states in Chinese that this check 'must be executed first' upon receiving an Amazon listing request, and the user-facing output strings are also fixed in Chinese. This indicates a language/locale assumption without any opt-in or documented justification, which conflicts with the policy against forcing a specific language.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def post(url: str, payload: dict[str, Any], headers: dict[str, str] | None = None, timeout: int = 20) -> dict[str, Any]:
import requests
response = requests.post(url, json=payload, headers=headers, timeout=timeout)
response.raise_for_status()
return response.json()
The manifest describes image processing in terms of white background handling, cropping, and translation for Amazon listing drafts. General-purpose detect-elements and remove-elements operations introduce broader image analysis/editing functions, including logo, watermark, QR code, and character removal, that are not clearly necessary for the declared workflow.
The manifest scopes image handling to Amazon listing preparation tasks such as white background, cropping, and translation. This file additionally exposes virtual try-on submission/query and model-change generation APIs, which are marketing/creative image generation features not justified by the stated purpose of turning 1688 items into Amazon draft listings.
This code sends payloads containing image URLs and processing parameters to an external HTTP endpoint via requests.post. While the module docstring mentions an image gateway, there is no user-facing confirmation, warning, or explicit disclosure in the code that offer image data will be transmitted to a remote service.
This Python file makes an HTTP POST request to query Dianxiaobao user information using a user ID, which may transmit user or account data to an external service. Aside from a brief module docstring, there is no confirmation prompt, user-facing log/print, or explanatory comment near the operation disclosing that account information is being fetched.
This function also performs an HTTP POST to retrieve account/store data tied to DXB_USER_ID. There is no nearby comment, log, or prompt informing the user that executing this path will contact a remote service and fetch account-linked store information.
The top-level docstring says 'release Amazon listing through Dianxiaobao', which implies actual publishing. However, the implementation hard-restricts release type to 'localSave' via release_type() and validate_release_type(), and even emits a draft-only message stating publishing is not supported. This is an active contradiction between documentation and behavior, not just missing detail.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def _run_script(label: str, script_name: str, *args: str, timeout: int = 180) -> None:
command = [sys.executable, str(SCRIPTS / script_name), *args]
result = subprocess.run(
command,
cwd=str(ROOT),
capture_output=True,
The manifest specifies PyJWT with a lower bound only (>=2.8.0) rather than pinning or constraining to a known-safe range, so builds may resolve to vulnerable versions depending on install time and index state. In a skill that likely handles authenticated sessions and tokens for Amazon/store workflows, a vulnerable JWT library could affect token validation or enable abuse if the code relies on affected features.
The requests dependency is not pinned, so deployments may install a release affected by known vulnerabilities, making the security posture unverifiable. Given this skill’s purpose involves network access to external services and likely session initialization, any requests flaw involving credential leakage, SSRF, or TLS/verification behavior is more relevant than in an offline tool.
Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.
This markdown file states that image-processing authorization uses ALI_1688_AK and a CSK signature, which indicates the skill relies on sensitive credentials. The reference describes the secret usage but does not include any warning to users about credential sensitivity, storage, or exposure risks.
This code emits user-facing error and guard messages only in Chinese, such as the session path errors and missing-field messages. The file also defines a default language tag of en_US, but the actual prompts do not offer any language/locale choice or document a justified locale restriction, which fits the policy-violation criterion for forced language without opt-in.