Back to skill

Security audit

Email Campaign Management

Security checks for vulnerabilities and agentic risk

Overview

The skill fits an email-campaign workflow, but it includes production email sending and account trial activation patterns that can expose recipient data and change subscription state without clear safeguards.

Review this skill carefully before installing. It should only be used by operators authorized to send marketing email and modify subscription records. Prefer adding explicit approval gates, dry-run defaults, recipient-list validation, opaque campaign tokens instead of email query parameters, and clear production-environment safeguards.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:258
Finding

Recipient Email Addresses Exposed in Registration URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 258–267
Vulnerability Type: Personal data exposure through URL query parameters
Risk Level: Medium

Complete Code Snippet:

html
### Required Template Variables
```html
<!-- Email parameter for personalized links -->
<a href="https://www.ainative.studio/register?gift={{campaign_id}}&email={{email}}">
    Claim Your Trial
</a>
text

The associated sending workflow replaces `{{email}}` with the recipient's actual email address before delivery:

```python
# Replace template variables
html = template_html.replace("{{email}}", email)
html = html.replace("{{campaign_id}}", campaign_id)

Technical Analysis

The campaign template places a recipient's email address directly in a URL query parameter. Because the sending function substitutes {{email}} with the actual address, the delivered link contains plaintext personally identifiable information.

Query strings can be retained or exposed through:

  • Browser history and synchronized browser data
  • Web server, reverse-proxy, CDN, firewall, and monitoring logs
  • Analytics and observability platforms
  • Screenshots, copied links, and forwarded messages
  • Referrer headers when the registration page loads third-party or cross-origin resources, subject to the effective referrer policy

The email value is also controlled by the client after delivery. A recipient can edit the query parameter before opening the registration page. If the backend relies on this value for identity, trial activation, conversion attribution, or authorization without independent validation, an attacker could cause incorrect attribution or attempt to associate campaign actions with another address.

Sending a recipient address to the declared email provider is necessary for email delivery, but including that address in a registration URL is not the minimum disclosure required for campaign attribution.

A

...[truncated 1478 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the plaintext email query parameter with a cryptographically random, opaque, single-use campaign token.
  2. Store only the necessary server-side association between the token, campaign, and intended recipient.
  3. Give each token a short expiration time and invalidate it after successful use.
  4. Alternatively, use a signed token that is integrity-protected, time-limited, audience-bound, and free of plaintext PII.
  5. Validate campaign and recipient associations exclusively on the server. Never treat a client-controlled email parameter as proof of identity or authorization.
  6. Prevent token replay and require normal account verification before activating a trial or modifying a subscription.
  7. Remove or redact email-bearing query strings from application, proxy, CDN, analytics, and observability logs.
  8. Configure a restrictive Referrer-Policy, such as no-referrer, on registration and campaign landing pages.
  9. Review historical logs and analytics stores for previously captured email-bearing URLs, then delete or redact them according to the applicable retention policy.
  10. Add automated tests confirming that generated campaign links contain neither email addresses nor other recipient PII.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explicitly instructs sending campaign and reminder emails through the external Resend API but does not require any user-facing notice, consent check, or approval step before transmitting recipient email addresses and campaign metadata to a third party. In a reusable agent skill, this omission can cause silent disclosure of personal data and operational misuse at scale.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 114)May include surrounding context.

md
import requests

RESEND_API_KEY = os.getenv("RESEND_API_KEY")
RESEND_API_URL = "https://api.resend.com/emails"
FROM_EMAIL = "no-reply@ainative.studio"

def send_campaign_email(email: str, campaign_id: str, template_html: str):

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This code sends data to an external API endpoint using requests.post, including recipient addresses, email content, and campaign tags. While external transmission is expected for an email-delivery integration, the skill does not pair it with validation, minimization, or user-approval requirements, so sensitive or regulated recipient data could be transmitted without adequate controls.

Content

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

md
]
    }

    response = requests.post(
        RESEND_API_URL,
        headers={
            "Authorization": f"Bearer {RESEND_API_KEY}",

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trial activation workflow performs live state-changing database operations: it updates or inserts subscription records, grants ENTERPRISE access, and marks campaign clicks as converted, all without any approval gate, dry-run mode, or explicit warning that production account state will change. In an agent-driven workflow, this raises the risk of accidental privilege changes, billing/state corruption, and unauthorized account modification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.