Summary
A SQL identifier quoting flaw in the Apache Iceberg write component of AWS SDK for pandas (awswrangler) may let an authenticated user with permission to modify AWS Glue Data Catalog metadata influence SQL generated during a write operation. If a more privileged principal performs the affected operation, a crafted column name could allow unauthorized table reads or writes to the table that principal is updating.
Affected context
The issue affects the Apache Iceberg write component in AWS SDK for pandas (awswrangler) versions 3.5.2 through 3.17.0. It becomes relevant when a write operation constructs SQL identifiers from column names and an authenticated user can modify the associated AWS Glue Data Catalog metadata.
Exploit preconditions
- Attack surface: Apache Iceberg write operations that construct SQL identifiers using catalog metadata
- Required access: Authentication and permission to modify relevant AWS Glue Data Catalog metadata
- Trigger point: A more privileged principal performs a write operation involving the crafted column name
- Why exploitation is possible: Quoting syntax in the identifier is not properly neutralized, allowing the name to affect the generated SQL
Why this happens
The underlying flaw is improper neutralization of quoting syntax when constructing SQL identifiers. If a column name derived from modifiable metadata is incorporated into SQL without correct identifier-specific escaping or safe construction, its quoting characters may change how the query is interpreted. This is SQL injection (CWE-89) and is also associated with improper neutralization of quoting syntax (CWE-149).
Potential impact
- An attacker may be able to read tables accessible to the more privileged principal.
- An attacker could cause writes to the table that principal is updating.
- Sensitive data could be exposed or modified, affecting confidentiality and integrity.
General mitigation guidance
Defensive patterns focus on keeping untrusted metadata from changing SQL structure:
- Use database and engine-supported identifier quoting or structured query APIs rather than assembling SQL identifiers through string concatenation.
- Validate column names against an expected schema and reject unexpected identifiers before query construction.
- Treat catalog metadata as untrusted, even when it is managed within the organization.
- Limit permissions for principals that modify catalog metadata and for identities that perform Iceberg writes.
- Separate metadata-management privileges from data-access privileges where practical, and use least-privilege access for write operations.
How teams detect issues like this
- Use static analysis to identify SQL construction that interpolates metadata-derived names or uses generic escaping for identifiers.
- Review code paths that build SQL for Iceberg writes, including how column names are validated and quoted.
- Add tests with unusual quoting characters in identifiers to verify that query structure cannot be altered.
- Enforce code review or CI policies requiring safe identifier-construction APIs and schema validation.
- Review catalog metadata changes and investigate unexpected identifiers in tables used by privileged write operations.

