Back to skill

Security audit

Sarvam AI

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Sarvam AI CLI that sends user-chosen text, audio, and chat prompts to Sarvam's API using the user's API key, with no hidden persistence or destructive behavior found.

Install only if you are comfortable sending selected text, recordings, and chat prompts to Sarvam AI. Do not submit confidential or regulated audio or text unless your use of Sarvam's service is approved, and keep SARVAM_API_KEY scoped and protected.

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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • 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)

Tainted flow: 'headers' from os.environ.get (line 110, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/sarvam_cli.py (reported line 51)May include surrounding context.

python
}
    
    try:
        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()
        
        audio_data = response.json()

Tainted flow: 'headers' from os.environ.get (line 110, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/sarvam_cli.py (reported line 124)May include surrounding context.

python
}
    
    try:
        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()
        
        audio_data = response.json()

Tainted flow: 'headers' from os.environ.get (line 110, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/sarvam_cli.py (reported line 96)May include surrounding context.

python
"mode": mode
                 # "prompt": "" # Optional prompt
            }
            response = requests.post(url, headers=headers, files=files, data=data)
            response.raise_for_status()
            print(json.dumps(response.json(), indent=2))

Tainted flow: 'chat_headers' from os.environ.get (line 136, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/sarvam_cli.py (reported line 155)May include surrounding context.

python
}

    try:
        response = requests.post(url, json=payload, headers=chat_headers)
        response.raise_for_status()
        result = response.json()

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares executable behavior that uses environment variables and makes external API calls, but it does not declare an explicit tool scope such as permissions or allowed-tools. This creates a transparency and policy-enforcement gap: users and orchestrators may invoke the skill without clear awareness that it can access secrets and transmit data over the network.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation encourages sending text and audio to Sarvam AI for TTS, STT, translation, and chat, but it does not clearly warn users that their inputs are transmitted to a third-party service. This can lead to unintentional disclosure of sensitive or regulated data, especially for audio transcripts, prompts, or API-driven chat content that users may assume is processed locally.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/sarvam_cli.py (reported line 51)May include surrounding context.

python
}
    
    try:
        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()
        
        audio_data = response.json()

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/sarvam_cli.py (reported line 124)May include surrounding context.

python
}
    
    try:
        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()
        
        audio_data = response.json()

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/sarvam_cli.py (reported line 155)May include surrounding context.

python
}
    
    try:
        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()
        
        audio_data = response.json()

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The speech-to-text command reads a local audio file and uploads it to a third-party remote API without any explicit user-facing warning at the point of use. In a CLI handling potentially sensitive recordings, this can lead to accidental disclosure of private or regulated audio content because users may assume processing is local.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/sarvam_cli.py (reported line 134)May include surrounding context.

python
print(e.response.text)

def chat_completion(message, model="sarvam-2g", system_prompt=None):
    url = "https://api.sarvam.ai/chat/completions"

    chat_headers = {
         "Authorization": f"Bearer {API_KEY}",

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The CLI sets default language codes such as hi-IN for text-to-speech and en-IN/hi-IN for translation, which imposes a specific locale behavior when users do not choose one. This is a natural-language policy concern because the file does not offer explicit locale opt-in or explain why India-specific defaults are required.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.