Back to skill

Security audit

Risha.ai Content Generation

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent Risha.ai API helper, but it exposes reusable account credentials in normal output and lets the API destination be changed without safeguards.

Review before installing. Use only with a verified Risha API host, avoid --base-url or RISHA_API_BASE_URL unless you explicitly trust the destination, do not run the login command where stdout is logged unless credentials are redacted, and avoid submitting confidential media or callback URLs you do not control.

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
scripts/risha_api.py:434
Finding

Reusable Authentication Tokens and Session Cookies Exposed Through Standard Output

Content
View full analysis
int: client = RishaClient(base_url=args.base_url) payload = client.login() result = { "login_response": payload, "derived_authorization_header": client.session_header, "cookies": deepcopy(client.cookie_jar), } print(json_dump(result)) return 0 ``` Related authentication-header construction occurs at lines 251–258: ```python def get_auth_header(self) -> str | None: env_header = os.environ.get("RISHA_AUTH_HEADER") if env_header: return env_header.strip() if self.session_header: return self.session_header username = os.environ.get("RISHA_BASIC_USERNAME") password = os.environ.get("RISHA_BASIC_PASSWORD") if username and password: token = base64.b64encode(f"{username}:{password}".encode("utf-8")).decode("ascii") return f"Basic {token}" return None ``` ### Technical Analysis The `login` command deliberately prints three potentially sensitive objects: - The complete login response, which may contain tokens or account information. - The derived Bearer authorization header. - All session cookies captured from the login response. In an AI Agent environment, standard output can be returned to the model, retained in conversation history, stored in execution logs, or exposed to downstream tooling. Bearer tokens and session cookies are reusable authentication secrets and must not appear in normal command output. The Base64 operation at line 257 is conventional HTTP Basic authentication encoding and is not encryption. Although that encoded Basic credential is not directly printed by `command_login`, it remains sensitive because it is a reversible representation of the username and password. The directly conf ...[truncated 1773 chars]
Remediation
View remediation
int: client = RishaClient(base_url=args.base_url) client.login() print(json_dump({"authenticated": True})) return 0 ``` 2. Never print: - Authorization headers. - Access or refresh tokens. - Session cookies. - Raw login responses that have not been sanitized. - Base64-encoded Basic credentials. 3. Implement recursive response redaction before displaying any authentication-related payload. Redact keys such as: - `access` - `access_token` - `refresh` - `refresh_token` - `token` - `jwt` - `authorization` - `cookie` - `set-cookie` - `password` - `secret` 4. If troubleshooting requires confirmation of token extraction, print only non-sensitive metadata, such as whether a token or cookie was detected: ```json { "authenticated": true, "auth_method": "bearer", "session_cookie_received": true } ``` 5. Add automated tests that run the login-output formatter with synthetic tokens and cookies and assert that none of the secret values appear in stdout or stderr. 6. Document that Agent transcripts and tool output are not secure secret-storage channels. Require users to supply credentials through protected environment or secret-management facilities. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/risha_api.py:240
Finding

Unrestricted API Base URL Allows Authentication Material to Be Sent to an Attacker-Controlled Host

Content
View full analysis
Any: query = urllib.parse.urlencode({k: v for k, v in (params or {}).items() if v is not None}, doseq=True) url = f"{self.base_url}{path}" if query: url = f"{url}?{query}" data: bytes | None = None headers = { "Accept": "application/json", "User-Agent": USER_AGENT, } if payload is not None: data = json.dumps(payload).encode("utf-8") headers["Content-Type"] = "application/json" auth_header = self.get_auth_header() if auth_header: headers["Authorization"] = auth_header if self.cookie_jar: headers["Cookie"] = "; ".join(f"{name}={value}" for name, value in self.cookie_jar.items()) request = urllib.request.Request(url, data=data, method=method.upper(), headers=headers) ``` The command-line interface exposes the override to every command: ```python def add_common_auth_args(parser: argparse.ArgumentParser) -> None: parser.add_argument("--base-url", help ...[truncated 3776 chars]
Remediation
View remediation
str: parsed = urllib.parse.urlsplit(raw_url) origin = f"{parsed.scheme}://{parsed.netloc}" if parsed.scheme != "https": raise RishaClientError("The Risha API URL must use HTTPS.") if origin not in TRUSTED_ORIGINS: raise RishaClientError("Untrusted Risha API origin.") if parsed.username or parsed.password: raise RishaClientError("Embedded URL credentials are prohibited.") return raw_url.rstrip("/") ``` 2. Apply validation to command-line and environment-derived URLs before storing `self.base_url`. 3. Prefer removing `--base-url` entirely unless alternate Risha deployments are a documented requirement. 4. If custom hosts must be supported: - Require explicit user approval for the exact origin. - Display the destination before authentication. - Do not infer approval from untrusted prompt content. - Maintain a persistent administrator-managed allowlist. - Require HTTPS with normal certificate validation. - Reject embedded credentials, unexpected ports, IP literals, and non-network schemes unless specifically approved. 5. Bind authentication state to the origin where it was obtained. If the origin changes, clear: - `session_header` - `cookie_jar` - Any cached credentials or login state 6. Never forward Authorization or Cookie headers across origin changes or redirects. 7. Separate login from ordinary API requests so email and password can only be submitted to the trusted authentication origin. 8. Update `SKILL.md` to state that credentials must only be transmitted to the verified Risha API origin and that endpoint changes require explicit user confirmation. 9. Add tests proving that attacker-controlled hosts, plaintext HTTP URLs, embedded-credential URLs, and unexpected o ...[truncated 61 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill instructs use of environment-provided credentials, local file reads/writes, and authenticated network calls, but it does not declare any explicit tool scope or permission boundaries. Without a scoped allowlist, an agent runtime may grant broader access than intended, increasing the chance of credential misuse, unintended exfiltration of account data, or modification of local reference files during normal execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This catalog defines many capabilities that transmit user-provided text, images, audio, and video to external services such as Risha-managed APIs and third-party providers, but the file contains no user-facing disclosure, consent, or data-handling warning. In a skill explicitly designed to discover and execute remote generation capabilities, silent transmission of sensitive media meaningfully increases privacy and compliance risk because users may unknowingly upload personal or regulated data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The Video Translation capability accepts uploaded videos and processes spoken content, which can expose faces, voices, bystanders, and other highly sensitive personal data. Because the catalog provides no warning or consent language about biometric/voice processing or third-party handling, users could unintentionally submit privacy-sensitive recordings for remote analysis and transformation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Music Generation requires a user-specified callback URL, which causes generated results and task metadata to be delivered to an external endpoint chosen at request time. Without warning or validation guidance, this can lead to accidental data exfiltration, SSRF-style abuse against internal endpoints, or delivery of outputs to untrusted destinations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Several dialect configuration values contain hard constraints such as 'Output spoken Arabic only in the target dialect' and 'Do not output Latin transliteration,' which impose a strict language choice. Because these policy strings are embedded as system instructions rather than framed as a user-selected output-language preference in this file, they risk enforcing a specific language/format beyond the user's explicit request.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This markdown file documents a "Video Translation" capability that requires users to upload a video file and specify an output language, which implies transmission and processing of potentially sensitive user media. The description contains no warning about privacy implications, external processing, or handling of uploaded content, which is a missing user disclosure for a markdown skill description.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The login command prints reusable session credentials, including a derived Authorization header and captured cookies, directly to stdout. In an agent skill context, stdout is commonly logged, surfaced to upstream orchestrators, or retained in transcripts, so this can leak bearer tokens or session cookies that allow account takeover of the Risha workspace for the lifetime of the token/session.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This command exposes derived authorization headers and cookies without any warning, which materially increases the chance that users or calling agents will unknowingly disclose live session credentials. Because this skill is specifically designed to authenticate to a remote workspace and execute account capabilities, leaked credentials provide direct unauthorized access rather than merely revealing low-value metadata.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
71% confidence
Finding

The "Video Translation" capability restricts output_language to a hard-coded list of six languages. Because the file provides no explanation that this is a provider limitation or region-specific constraint, it reads as an unexplained language/locale restriction in the skill's natural-language specification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The "AI Script Writer" capability exposes a dialect field limited to six specific locales, with no explanation of why only those dialects are supported. This is a natural-language locale restriction that should be justified or framed as a provider capability limitation to avoid policy concerns around forced locale constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The "Arabic Dialects Text-to-Speech" capability restricts system_instruction to six dialects and voices to a specific predefined set, but the file does not explain that these are current supported options or a region-specific feature. Without that justification, the natural-language specification presents an unexplained locale constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The generate workflow sends user-supplied prompt_data to the remote /generation-requests/ endpoint after loading it from inline JSON, a file, or field arguments. Although network use is part of the CLI's purpose, there is no visible disclosure in this command path or help text that supplied content will be transmitted to an external service and may include sensitive data.

Content

No source excerpt is available for this finding.