/

CVE-2026-47255

Severity:

HIGH RISK

(8.2)

Input Validation and Access Control Flaws in AgenticMail

CVE-2026-47255

Deferred

Vulnerability type

Category:

Input Validation and Access Control Weakness

CWE:

CWE-20, CWE-89, CWE-284, CWE-319, CWE-798

Impact:

Privilege Escalation and Data Tampering

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Multiple input validation and access control weaknesses in AgenticMail's API and core libraries expose email and telephony workflows to abuse.

When agents or external systems can send unvalidated parameters to storage SQL, ownership checks, SMTP commands, or TLS configuration, attackers may escalate privileges, tamper data, or weaken transport security.

Affected context

The issues arise in AgenticMail deployments where AI agents are given real email addresses and phone numbers and rely on @agenticmail/api and @agenticmail/core for message handling, storage, and outbound delivery.

Risk is elevated when:

  • Agent hour filtering and storage SQL identifiers are accepted with minimal validation
  • Ownership enforcement for raw storage SQL depends solely on metadata
  • Direct access to storage metadata is possible via raw SQL interfaces
  • Outbound worker secrets are not handled in a fail-closed manner
  • SMTP envelopes and headers are constructed without strict control-character checks
  • MailSender is configured without proper TLS certificate verification, especially beyond local development setups.

Exploit preconditions

  • Attack surface: Agent APIs, outbound worker interfaces, and storage SQL endpoints reachable by agents, services, or operators.
  • Required access: Ability to submit agent commands, configuration changes, or SQL-like identifiers; and influence mail-sending configuration or SMTP parameters.
  • Trigger point: Processing of unvalidated fields for inactive-agent hour filtering, storage SQL identifiers, ownership metadata, outbound secrets, SMTP envelopes/headers, or TLS options during routine workflows.
  • Why exploitation is possible: The system trusts input and metadata too broadly, lacks comprehensive validation and fail-closed behavior, and exposes low-level storage and transport controls without robust guardrails.

Why this happens

The vulnerabilities stem from a combination of weak input validation (CWE-20), insufficient SQL identifier and query protection (related to CWE-89), overly permissive or metadata-only authorization checks (CWE-284), insecure handling of secrets and transport security (CWE-319, CWE-798), and reliance on non-fail-closed patterns.

In abstract terms, the platform allows agents and services to influence core storage and messaging behavior through parameters that are not rigorously validated, not properly bound to least-privilege roles, and sometimes processed without secure defaults for encryption and credential handling. This creates multiple pathways where untrusted data can cross trust boundaries into storage, SMTP command construction, or TLS configuration.

Potential impact

  • Agents or users could bypass inactive-agent hour filtering and perform unauthorized actions.
  • Storage SQL identifiers could be abused to read or modify unintended data sets.
  • Metadata-backed ownership checks may be circumvented, enabling unauthorized access to raw storage SQL.
  • Direct access to storage metadata via raw SQL could expose sensitive structural or tenancy information.
  • Mismanaged outbound worker secrets could allow misuse of mail-sending infrastructure.
  • Crafted SMTP envelopes or headers might lead to header injection, message spoofing, or delivery anomalies.
  • Weak TLS verification options could enable man-in-the-middle attacks on outbound email connections.

General mitigation guidance

Durable mitigation focuses on strengthening validation, authorization, and secure defaults across the messaging pipeline.

Recommended patterns include:

  • Applying strict input validation and normalization for agent filters, storage identifiers, and SMTP parameters, rejecting malformed or unexpected values.
  • Enforcing least-privilege access to storage and SQL layers, with ownership tied to stable, non-spoofable attributes rather than easily manipulated metadata.
  • Designing raw SQL interfaces to be inaccessible from agent-facing layers, favoring parameterized, well-bounded queries or APIs instead.
  • Handling outbound worker secrets in a fail-closed manner, where missing or inconsistent credentials halt operations rather than degrade to insecure behavior.
  • Treating TLS certificate verification as a secure default and isolating any local development opt-outs so they cannot be enabled in production.
  • Using layered authorization checks that combine role-based policies with contextual constraints to reduce abuse of AI agents' communication capabilities.

How teams detect issues like this

Detection typically involves examining both code and configuration for trust boundary violations and insecure patterns.

Effective approaches include:

  • Static analysis rules that flag dynamic or unvalidated SQL identifier usage, direct metadata access, and bypassable ownership checks.
  • Targeted code review focusing on agent hour filters, storage access paths, SMTP command builders, and MailSender TLS options, looking for missing validation, parameterization, or authorization controls.
  • Policy-based enforcement to ensure TLS verification remains enabled in non-development environments and secrets are never processed with permissive defaults.
  • Logging and anomaly detection on storage queries and outbound mail patterns to identify unusual access to metadata, unexpected SQL shapes, or abnormal SMTP header structures.
  • Optional use of automated security review tools to continuously scan for CWE-20, CWE-89, CWE-284, and related misconfiguration patterns in the codebase and deployment manifests.

Sources

SourceLink
github.comgithub.com/agenticmail/agenticmail/blob/7b9b05d973676e9f3d097c08b8e649f59bfc15d0/CHANGELOG.md?plain=1#L1842
github.comgithub.com/agenticmail/agenticmail/blob/7b9b05d973676e9f3d097c08b8e649f59bfc15d0/packages/core/src/mail/sender.ts#L33
github.comgithub.com/agenticmail/agenticmail/commit/1408de543fa3577d8c2d4fdb289c75fe6faafac7
github.comgithub.com/agenticmail/agenticmail/commit/234b811e426a0743170f3b10bc43419d64330155
github.comgithub.com/agenticmail/agenticmail/commit/6c70c8254c906f823392d7f5ccee88a5481e7731
github.comgithub.com/agenticmail/agenticmail/commit/8cb053f2307dd77b7736ffa0d7df04b0ccc3272d
github.comgithub.com/agenticmail/agenticmail/security/advisories/GHSA-wjjv-3mj2-39hf

Frequently asked

questions

Yes, in many deployments. If remote agents or client systems can reach the AgenticMail API or outbound workers and send crafted parameters, they may exploit the validation and access control weaknesses without direct server access.

An attacker generally needs the ability to act as an agent or client, submit configuration or filtering parameters, or interact with storage-related or mail-sending endpoints. Elevated operational access can further amplify impact by exposing raw SQL or TLS configuration controls.

The safest pattern is to combine strict, schema-based input validation with parameterized and constrained storage access, robust ownership and authorization checks, and secure-by-default handling of secrets and TLS. Interfaces that expose raw SQL or transport toggles should be minimized or gated behind strong administrative controls.

Prevention hinges on designing APIs with clear trust boundaries, enforcing least-privilege principles, and treating secure defaults (like TLS verification and fail-closed secret handling) as non-negotiable. Integrating validation libraries, authorization frameworks, and automated security checks into the development and deployment pipelines helps detect and block similar classes of flaws before release.

Find out what's already
exploitable in your codebase.