/

CVE-2026-34385

Severity:

HIGH RISK

(8.1)

SQL Injection in Fleet Apple MDM Profile Delivery Pipeline

CVE-2026-34385

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Confidentiality, Integrity, and Authentication Data Compromise via SQL Injection

Severity:

HIGH RISK

(8.1)

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

A second-order SQL injection flaw in Fleet's Apple MDM profile delivery pipeline allows crafted data, previously stored in the database, to be re-used in later queries without proper sanitization.

An attacker with a valid MDM enrollment certificate may leverage this to exfiltrate or modify Fleet database contents, including user credentials, API tokens, and device enrollment secrets.

Affected context

This vulnerability arises in Fleet deployments that use the Apple MDM profile delivery pipeline and accept device data associated with MDM enrollment certificates.

Data originating from MDM-enrolled devices is stored in the Fleet database and later reused in SQL queries without consistent parameterization or proper escaping.

The issue manifests not at the point of initial data ingestion, but when that stored data is subsequently incorporated into database queries, which is characteristic of a second-order SQL injection scenario.

Exploit preconditions

  • Attack surface: Fleet server endpoints associated with Apple MDM enrollment and profile delivery.
  • Required access: A valid Apple MDM enrollment certificate allowing the attacker to register or manage a device in the Fleet-managed environment.
  • Trigger point: Use of previously stored, attacker-controlled values from MDM-related records when constructing SQL queries in later operations.
  • Why exploitation is possible: Application logic implicitly trusts data persisted from authenticated MDM interactions and later interpolates those values into SQL statements without parameterized queries or adequate validation, enabling crafted input to alter query structure.

Why this happens

The core issue is improper neutralization of data used in SQL commands, corresponding to CWE-89: SQL Injection.

In this case, the vulnerability is second-order: the attacker-controlled data is first stored in the database in an apparently benign form, then later concatenated into SQL statements or otherwise incorporated into query construction without using prepared statements, parameter binding, or robust escaping.

Because the application treats stored MDM-related fields as trusted, they bypass typical input validation and end up influencing the structure of subsequent queries, leading to unauthorized data access and modification.

Potential impact

  • Exfiltration of sensitive database records, including user credentials (e.g., password hashes).
  • Theft or misuse of API tokens, leading to further unauthorized API access.
  • Exposure or manipulation of device enrollment secrets, potentially enabling rogue device enrollment or impersonation.
  • Unauthorized modification or deletion of Fleet data, such as device records, policies, and configurations.
  • Escalation of privileges within the Fleet environment by tampering with role or permission data.

General mitigation guidance

Effective mitigation focuses on eliminating dynamic SQL construction using any data that can be influenced by external actors, even if that data is stored and later reused.

Recommended defensive patterns include:

  • Using parameterized queries or prepared statements for all database interactions, ensuring that data values cannot change query structure.
  • Applying strict input validation and canonicalization to all MDM-related fields before storage, treating them as untrusted even when submitted via authenticated channels.
  • Centralizing database access in a data-access layer that enforces parameterization and prevents ad hoc string concatenation of SQL.
  • Minimizing the storage of sensitive secrets in clear form and applying cryptographic protections or tokenization where appropriate.
  • Applying least-privilege principles to database accounts so that, if injection occurs, the reachable data and operations are constrained.

How teams detect issues like this

Detection typically relies on a combination of code-level and runtime approaches:

  • Static analysis: Configure rules to flag string-based SQL construction, especially where query fragments are derived from stored fields or MDM-related data structures.
  • Code review: During manual reviews, inspect the Apple MDM profile delivery and enrollment code paths for any query building that does not use parameter binding; pay particular attention to data that flows from device enrollment into SQL queries.
  • Database monitoring: Enable logging of SQL queries and alerts for anomalous patterns such as stacked queries, always-true conditions, or unusual access to credential and token tables.
  • Policy enforcement: Use secure coding guidelines and CI checks to prevent introduction of new dynamic SQL patterns and to ensure all new database operations use safe abstractions or ORM features.

Sources

SourceLink
github.comgithub.com/fleetdm/fleet/security/advisories/GHSA-v895-833r-8c45

Frequently asked

questions

It can be remotely exploitable if the Fleet server is network-accessible and the attacker possesses or can obtain a valid Apple MDM enrollment certificate, since exploitation occurs through the MDM profile delivery pipeline rather than direct SQL access.

The attacker must have a valid MDM enrollment certificate and the ability to interact with Fleet as an enrolled device or similar MDM client. They do not need direct database credentials, but they do need to control data that Fleet stores and later reuses in SQL queries.

The most robust approach is to ensure all SQL interactions use parameterized queries or ORM methods that separate query structure from values, combined with treating all externally influenced data (including authenticated and stored data) as untrusted and validating it before use.

Adopt a secure-by-default data access layer that prohibits dynamic SQL string building, enforce coding standards and automated checks for SQL injection patterns, and perform regular security reviews of flows where stored user or device data is reused in downstream logic.

Find out what's already
exploitable in your codebase.