Back to skill

Security audit

Dialogflow Cx Nlu

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Dialogflow CX management helper, but users should treat its create, update, import, and delete operations as live cloud configuration changes.

Install only if you intend to let the agent work with your Dialogflow CX project. Use least-privilege Google credentials, verify every project, location, agent, intent, and entity type name before running mutating commands, and test against non-production agents first because delete and import/update actions can change or remove live bot behavior.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (1)

T08 · Insecure Dependencies

Warning
Location
scripts/nlu.py:16
Finding
Unpinned Third-Party Dependencies Permit Unsafe Supply-Chain Updates## Vulnerability Details **File Location**: `scripts/nlu.py:16-22` and `scripts/nlu.py:38-40` **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Medium ### Vulnerable Code ```python Requires: - google-cloud-dialogflow-cx - google-auth Install: pip install google-cloud-dialogflow-cx google-auth ``` ```python except ImportError: print("Error: google-cloud-dialogflow-cx not installed") print("Run: pip install google-cloud-dialogflow-cx google-auth") sys.exit(1) ``` ### Technical Analysis The installation instructions direct users to install mutable, unconstrained versions of `google-cloud-dialogflow-cx`, `google-auth`, and their transitive dependencies. The project does not provide version constraints, cryptographic hashes, or a dependency lockfile. Although the named packages are consistent with the declared Google Cloud functionality and no typosquatting was identified, unconstrained dependency resolution makes installations non-reproducible. A future compromised or unexpectedly incompatible release could be selected without further review. Python packages may execute code during installation or whenever imported; this script imports the dependencies immediately at lines 27-33. Exploitation therefore depends on compromise of a named package, its distribution channel, or one of its unconstrained transitive dependencies. The project itself does not contain evidence that these dependencies are currently malicious. ### Attack Path 1. An attacker compromises a future release of a named dependency, one of its transitive dependencies, or the associated package-distribution account. 2. A user follows the documented or runtime installation instruction: ```bash pip install google-cloud-dialogflow-cx google-auth ``` 3. Because no reviewed versions or hashes are enforced, `pip` resolves and installs the attacker-controlled release. 4. Malicious package code ...[truncated 756 chars]
Remediation
## Remediation Suggestions 1. Create a dependency manifest with exact, reviewed versions for all direct dependencies. 2. Generate a fully resolved lockfile that also pins transitive dependencies. 3. Record cryptographic hashes and require their verification during installation, for example: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Replace the unconstrained installation guidance in both the module documentation and error message with installation from the locked requirements file. 5. Use an isolated virtual environment rather than installing packages globally: ```bash python -m venv .venv . .venv/bin/activate python -m pip install --require-hashes -r requirements.txt ``` 6. Review and update pinned dependencies on a controlled schedule, using vulnerability and provenance checks before accepting new versions. 7. Run the CLI with a least-privileged Google Cloud identity whose IAM permissions are limited to the required Dialogflow CX resources.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
### Delete Entity Type
```
DELETE /v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}
```

### Export Entity Types
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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
### Delete Intent
```
DELETE /v3beta1/{name=projects/*/locations/*/agents/*/intents/*}
```

### Export Intents
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).

External Transmission

Medium
Category
Data Exfiltration
Content
### List Intents
```bash
curl -X GET \
  "https://dialogflow.googleapis.com/v3beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/${AGENT_ID}/intents" \
  -H "Authorization: Bearer ${TOKEN}"
```
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill includes authenticated create operations that modify Dialogflow CX intents and entity types, but it does not clearly warn users that these commands will change live agent configuration. In an agent skill context, users may copy/paste examples assuming they are read-only or low-risk, which can lead to unintended production changes if valid credentials and target IDs are already set.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The script exposes intent deletion via `delete_intent` and immediately performs the irreversible API call, only printing after the deletion has already happened. In this file there is no confirmation prompt or pre-action warning that the command will permanently remove the resource.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The `delete_entity_type` function performs an irreversible delete operation immediately and only logs the result afterward. The code does not provide a confirmation step, pre-action warning, or other user disclosure about the destructive behavior.

Missing User Warnings

Low
Confidence
84% confidence
Finding
This markdown file documents a DELETE endpoint for entity types but does not include any warning about the destructive effect of removing an entity type. Under the markdown-specific warning criteria, descriptions of actions that can affect system configuration or data integrity should disclose that impact.

Missing User Warnings

Low
Confidence
75% confidence
Finding
The Import Entity Types section describes an operation that can modify agent configuration, but the markdown provides no warning about possible replacement, merging behavior, or broader impact on existing entity types. Users are not alerted to the potential system-integrity consequences of running the import.

Static analysis

No suspicious patterns detected.