Back to skill

Security audit

alibabacloud-bailian-managed-agent

Security checks for vulnerabilities and agentic risk

Overview

This is a high-impact but coherent documentation and operations skill for Alibaba Cloud Bailian Managed Agents, with disclosed cloud, credential, webhook, and provisioning workflows.

Install only if you are comfortable giving the agent workspace-scoped Bailian Managed Agent authority. Use a test workspace first, keep API keys in environment or a secret store, require customer-controlled webhook receivers for real delivery, review every plan before apply or destroy, and avoid copying legacy examples that disable TLS verification or inspect secret-named variables unless you fully understand the placeholder model.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (106)

YARA rule 'agent_skill_credential_exfiltration_webhook': AI agent skill credential harvesting followed by webhook or external exfiltration [agent_skills]

Critical
Category
YARA Match
Confidence
94% confidence
Finding

The combination of creating webhooks to an external URL and handling secrets triggers a credible exfiltration concern. In this skill's context, directing users to register a webhook at a third-party domain can leak event metadata and create unintended outbound traffic; because the file discusses secrets and receiver implementation, the pattern is more dangerous than a generic webhook tutorial.

Content

Scanner excerpt · references/cookbook/06-webhook-event-notifications.md (reported line 44)May include surrounding context.

fixed example/evaluation convention. A real test needs a customer-controlled receiver. The example describes resource creation and read-back only; it does not claim that Baidu receives or processes Webhook notifications. For the receiver implementation, delivery test and signature verification in later sections, first replace the sample URL with the customer's actual controlled receiver.

bash
curl --user-agent "$BAILIAN_MANAGED_AGENT_SKILL_UA" --max-time 30 -s -X POST "$BASE/webhook_endpoints" \
  -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" \
  -d '{
    "description": "Shibei E-commerce reconciliation-task notifier",
    "url": "https://www.baidu.com",
    "events": ["session.status_run_started", "session.status_idled", "deployment_run.started", "deployment_run.succeeded", "deployment_run.failed"]
  }'

Illustrative creation response (key fields; the sample URL is updated to the evaluation convention):

json
{
  "id": "wep_01M1G63CXHX6C7C1801RD2J

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This is a strong description-behavior mismatch. The declared purpose describes a customer-facing/product-integration skill for Alibaba Cloud Bailian Managed Agent, including demos, provisioning, solutioning, and backend integration. The actual code chunk is a narrow utility that builds a User-Agent string from local metadata and a random session token. It uses no network, no cloud resources, no Bailian CLI, no HTTP API, and no SDKs. While helper utilities can support a larger skill, this chunk by itself does not implement or meaningfully evidence the declared core functionality, and its primary purpose is materially different from the description.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 75)May include surrounding context.

md
Is or infer MA native binding from Memory Library documentation. See [concepts](references/product/concepts.md#memory-store-working-memory).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 81)May include surrounding context.

md
Is or infer MA native binding from Memory Library documentation. See [concepts](references/product/concepts.md#memory-store-working-memory).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 127)May include surrounding context.

md
Is or infer MA native binding from Memory Library documentation. See [concepts](references/product/concepts.md#memory-store-working-memory).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 182)May include surrounding context.

md
o install CLI or create resources; for language implementations go directly to [references/integration/code-python.md](references/integration/code-python.md) or

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 182)May include surrounding context.

md
ferences/integration/code-python.md](references/integration/code-python.md) or [references/integration/code-java.md](references/integration/code-java.md). The f

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 182)May include surrounding context.

md
ints.md](references/integration/api-endpoints.md), auth and event contracts in [references/integration/api-quickstart.md](references/integration/api-quickstart.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
96% confidence
Finding

Recommending curl -k is a classic unsafe parameter pattern because it suppresses TLS certificate checks. In this context the danger is amplified: the same section discusses Authorization-header secret replacement, so disabling verification on outbound requests can expose sensitive authenticated traffic to interception or redirection.

Content

Scanner excerpt · references/cookbook/02-production-four-building-blocks.md (reported line 59)May include surrounding context.

md
This recipe adds the **trigger line**: in 01's world, sessions are created by your app and messages sent by your app — the role of "who sends the task at 7:30 in the morning" could only be a cron script you write yourself. **Deployment** absorbs that role into the platform: declaratively configure "which agent, pinned to which version, which messages delivered at trigger, which credentials attached, what schedule" — after that, scheduled triggering, session creation, and initial_events delivery are all done by the platform; your app only comes to look at results.

> **Security boundary (the 2026-09 model)**: once a token is stored in a vault it **never enters the sandbox** — `printenv` shows only the placeholder, secret plaintext never appears in model context or the event stream; on egress the gateway swaps it per the `allowed_hosts` allowlist. That is an order of magnitude safer than the old "plaintext environment-variable injection" (the old docs' warning that "printenv can read the real value; use the prompt to stop the agent printing credentials" is obsolete). But two boundaries still hold: the gateway replaces only the `Authorization` header; and sandbox outbound HTTPS goes through a gateway MITM, so strict TLS verification fails (`curl -k` fixes it) — details and pitfalls in 08.

---

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
95% confidence
Finding

The recipe instructs the agent to run printenv GITHUB_TOKEN to verify secret injection. Even though the current implementation is said to return a placeholder, teaching agents to harvest environment variables normalizes credential-access behavior and creates a brittle pattern that becomes dangerous if the platform regresses, other variables are used, or users copy the technique to plaintext-injected secrets.

Content

Scanner excerpt · references/cookbook/02-production-four-building-blocks.md (reported line 210)May include surrounding context.

Note: sessions.create accepts no initial-input field, so the standard pattern is two-step driving — "create the session, then separately POST one message event". (For "trigger with the first message attached", use the Deployment below, which supports initial_events, delivered at trigger time.)

Send a message to verify placeholder injection — have it run printenv GITHUB_TOKEN verbatim:

bash
curl --user-agent "$BAILIAN_MANAGED_AGENT_SKILL_UA" --max-time 30 -X POST "$BASE/sessions/$SESSION_ID/events" \

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
94% confidence
Finding

The documented event trace includes a bash tool call that executes printenv GITHUB_TOKEN. This evidences and reinforces a secret-inspection workflow inside the sandbox, which is risky because event streams, tool logs, or future behavior changes could expose sensitive values or encourage broader env harvesting.

Content

Scanner excerpt · references/cookbook/02-production-four-building-blocks.md (reported line 243)May include surrounding context.

md
session_status   {"session_status": "running"}
message          (user message echo)
model_request_start
tool_call        bash  {"command": "printenv GITHUB_TOKEN", ...}
tool_call_output bash  {"stdout":"BMA_SECRET_PLACEHOLDER_GITHUB_TOKEN\n","exit_code":0}
message          (assistant reports the output)
session_status   {"stop_reason": {"type": "end_turn"}, "session_status": "idle"}

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
93% confidence
Finding

The deployment example again causes the agent to execute printenv GITHUB_TOKEN, this time in an unattended scheduled workflow. Embedding env-harvesting behavior into scheduled runs increases operational risk because it can repeatedly expose placeholders or, under misconfiguration or future platform changes, real secrets into logs and artifacts without human review.

Content

Scanner excerpt · references/cookbook/02-production-four-building-blocks.md (reported line 348)May include surrounding context.

md
session_status   running
message          (user) Here is today's briefing task: 1) use bailian_web_search to search...   ← initial_events delivered
mcp_call         bailian_web_search  {"query": "tea industry latest news", "count": 10}
tool_call        bash  printenv GITHUB_TOKEN
mcp_call_output  (industry-news JSON returned by WebSearch)
tool_call_output (BMA_SECRET_PLACEHOLDER_GITHUB_TOKEN)
message          (assistant) **[v1] Yunling Tea morning brief · 2026-09-02** + 3 industry items

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/cookbook/02-production-four-building-blocks.md (reported line 413)May include surrounding context.

md
| Pause scheduling | `POST /deployments/{id}/pause` | `status: "paused"`, `paused_reason: {type: "manual"}`; **cron stops firing, `next_run_at` frozen** |
| Resume | `POST /deployments/{id}/unpause` | `status: "active"`, resumes from the next scheduled point; **triggers missed while paused are not caught up** (field test: pause spanned two whole minutes; after resume, the 03:11 slot was not made up) |
| Archive | `POST /deployments/{id}/archive` | `archived_at` set, `next_run_at` cleared (schedule released); GET still works, **listings filter archived items by default** |
| Delete | `DELETE /deployments/{id}` | **405 not supported** — same as agents: archive-only, no delete |

Three easily confused points (all field-tested):

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/cookbook/02-production-four-building-blocks.md (reported line 515)May include surrounding context.

md
| sessions | GET `/sessions`, `/{id}` | — | `POST /{id}/archive` | DELETE works |
| deployments | GET `/deployments`, `/{id}` (listings filter archived by default) | `POST /deployments/{id}` (watch agent drift, see 5.4) | `POST /{id}/archive` | **not supported** (DELETE 405) |
| vaults | GET `/vaults`, `/{id}` | `POST /vaults/{id}` | `POST /{id}/archive` | DELETE works |
| credentials | GET `/vaults/{id}/credentials` | — | — | `DELETE /vaults/{vid}/credentials/{cid}` |

List agents:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
60% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/cookbook/02-production-four-building-blocks.md (reported line 520)May include surrounding context.

List agents:

bash
curl --user-agent "$BAILIAN_MANAGED_AGENT_SKILL_UA" --max-time 30 -X GET "$BASE/agents?limit=5" \
  -H "Authorization: Bearer $API_KEY"

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/cookbook/03-prompt-versioning-and-rollback.md (reported line 67)May include surrounding context.

md
"body": "Hi, since this morning every request to POST /v1/chat returns HTTP 429 Too Many Requests even though our traffic pattern is unchanged. Did something change on the server side? Our request volume is the same as last week." },
  { "id": "T2", "expected": "auth",
    "subject": "OAuth token expired, cannot refresh",
    "body": "Our integration suddenly stopped working. The access token expired and the refresh call returns invalid_grant. We did not change any credentials on our side. Please help." },
  { "id": "T3", "expected": "billing",
    "subject": "Invoice amount does not match dashboard usage",
    "body": "My latest invoice shows API usage charges of $412 for July, but the usage report on the dashboard only adds up to $380. I checked every day of the month and the numbers do not reconcile. I need a corrected invoice." },

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · references/cookbook/04-multi-agent-custom-proposals.md (reported line 324)May include surrounding context.

List: GET /sessions/{session_id}/threads

bash
curl --user-agent "$BAILIAN_MANAGED_AGENT_SKILL_UA" --max-time 30 "$BASE/sessions/$SESSION_ID/threads" \
  -H "Authorization: Bearer $API_KEY"

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · references/cookbook/06-webhook-event-notifications.md (reported line 304)May include surrounding context.

bash
# The health-observation trio: last_success_at / last_failure_at / consecutive_fail
curl --user-agent "$BAILIAN_MANAGED_AGENT_SKILL_UA" --max-time 30 -s "$BASE/webhook_endpoints" -H "Authorization: Bearer $API_KEY" | python3 -m json.tool
json

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/cookbook/07-custom-mcp-and-skills.md (reported line 282)May include surrounding context.

Upload a new version (POST /skills/{skill_id}/versions; the request body likewise holds only file_id):

bash
# Edit SKILL.md (say, add "lowest price on the internet" to the banned list) -> repackage -> upload
curl --user-agent "$BAILIAN_MANAGED_AGENT_SKILL_UA" --max-time 30 -s -X POST "$BASE/skills/skill_MWY3ZTY5ZDE3MGIzNDFkZWI2Zj/versions" \
  -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" \
  -d '{"file_id": "file_889syqcvxriijfzl5xe9kci9"}'

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/cookbook/07-custom-mcp-and-skills.md (reported line 329)May include surrounding context.

md
Remember the MCP/Skills division in one line: **MCP gives the agent "hands" (which services it can call); a Skill gives the agent an "SOP" (by which procedure it works)**. Luming's review assistant mounts both: the RAG MCP lets it query the editorial standards, and the manuscript-check skill lets it run the health check by the senior editors' three looks — hands and method together.

Engineering checklist (in priority order): write SKILL.md's description to say clearly "when to use" (the model routes on it) -> leave review-wait slack in the upload pipeline (field-tested ~4 minutes) -> mount pinned to a concrete version (never follow latest) -> write script paths in the manual as relative usages -> assess mounted references before deleting.

---

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
60% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/cookbook/08-vault-secret-injection-and-egress-gateway.md (reported line 83)May include surrounding context.

Step 1 · Create the vault

bash
curl --user-agent "$BAILIAN_MANAGED_AGENT_SKILL_UA" --max-time 30 -X POST "$BASE/vaults" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/cookbook/11-live-resources-and-reviewed-deliverables.md (reported line 43)May include surrounding context.

md
Save the returned `sesrsc_...` **resource ID**. The returned `mount_path` is the full sandbox path; `file_id` may refer to a server-side copy.

- Read: have the Agent wait with a deadline for `/mnt/session/uploads/late.txt`, then read it. The test read the same three rows and computed 350.
- Unmount: `DELETE /sessions/{id}/resources/{resource_id}`; this is not deletion of the uploaded File.
- Verify: the resource list no longer contains the ID, and the Agent confirms the path has disappeared. Both checks passed.

Do not promise a fixed 35-second propagation delay; that was one historical observation. In this test, the path had appeared/disappeared by the first tool check. Use runtime checks with deadlines.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/integration/api-endpoints.md (reported line 45)May include surrounding context.

md
| **Environment** | `POST /environments` | Create |
| | `GET /environments/{environment_id}` / `GET /environments` | Get / list |
| | `POST /environments/{environment_id}` | Update |
| | `DELETE /environments/{environment_id}` | Hard delete |
| | `POST /environments/{environment_id}/archive` | Archive |
| **Session** | `POST /sessions` | Create (binds Agent + Environment, locking a snapshot of the agent's latest version at that moment; supports `environment_variables` plaintext injection of session env vars) |
| | `GET /sessions/{session_id}` / `GET /sessions` | Get / list |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/integration/api-endpoints.md (reported line 50)May include surrounding context.

md
| **Session** | `POST /sessions` | Create (binds Agent + Environment, locking a snapshot of the agent's latest version at that moment; supports `environment_variables` plaintext injection of session env vars) |
| | `GET /sessions/{session_id}` / `GET /sessions` | Get / list |
| | `POST /sessions/{session_id}` | Update metadata (e.g. rename) |
| | `DELETE /sessions/{session_id}` | Hard delete (metadata + event history + resource copies all wiped, unrecoverable) |
| | `POST /sessions/{session_id}/archive` | Archive (turns `terminated`; event history retained) |
| **Event** | `POST /sessions/{session_id}/events` | Send an event (user message / tool receipt); triggers the agent into `running` |
| | `GET /sessions/{session_id}/events` | List event history |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/integration/api-endpoints.md (reported line 62)May include surrounding context.

md
| **Session resources** | `POST /sessions/{session_id}/resources` | Runtime dynamic file mounting (no restart; verify sandbox visibility, not just HTTP success; Memory Store excluded) |
| | `GET /sessions/{session_id}/resources` | List mounted resources |
| | `GET /sessions/{session_id}/resources/{id}` | Query a single resource |
| | `DELETE /sessions/{session_id}/resources/{id}` | Unmount (cleans up the in-session copy; the original file is unchanged) |
| **File** | `POST /files` | Upload (`multipart/form-data`) |
| | `GET /files/{file_id}` / `GET /files` | Metadata / list |
| | `GET /files/{file_id}/content` | Download content (**note the `/content` suffix — `/download` 404s**; and only session artifacts with `downloadable=true` can be downloaded — accessing directly-uploaded files returns 403 code 11900007) |

Static analysis

Detected: suspicious.exposed_secret_literal, suspicious.prompt_injection_instructions

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/cookbook/02-production-four-building-blocks.md:39

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/cookbook/08-vault-secret-injection-and-egress-gateway.md:77

Prompt-injection style instruction pattern detected.

Warn
Code
suspicious.prompt_injection_instructions
Location
references/cookbook/03-prompt-versioning-and-rollback.md:170