Skip to content

Remove unused BSA native SQL query helper - #3119

Open
CydeWeys wants to merge 1 commit into
google:masterfrom
CydeWeys:fix-bsa-sqli
Open

CydeWeys wants to merge 1 commit into
google:masterfrom
CydeWeys:fix-bsa-sqli

Conversation

@CydeWeys

@CydeWeys CydeWeys commented Jun 29, 2026 •

Copy link
Copy Markdown
Member

Queries.queryUnblockablesByNames() interpolates domain label and TLD strings directly into a native SQL IN clause, creating a SQL injection surface if ever called with untrusted input. Auditing the codebase and git history confirms this package-private helper has had zero production callers since it was added in PR #2256: DomainsRefresher uses batchReadUnblockables() to inspect each row's reason during refresh, and LabelDiffUpdates queries by label via parameterized JPQL.

Removing this dead helper eliminates both the unsafe native SQL pattern and unnecessary maintenance surface; if composite-key lookups on BsaUnblockableDomain are ever needed in the future, tm().loadByKeysIfPresent() with BsaUnblockableDomain.vKey() or a static UNNEST query should be used instead.

  • Delete Queries.queryUnblockablesByNames() and its now-unused imports.
  • Delete the corresponding unit tests and setup helper in QueriesTest.

BUG=http://b/529387728


This change is Reviewable

Queries.queryUnblockablesByNames() interpolates domain label and TLD strings
directly into a native SQL IN clause, creating a SQL injection surface if ever
called with untrusted input. Auditing the codebase and git history confirms
this package-private helper has had zero production callers since it was added
in PR google#2256: DomainsRefresher uses batchReadUnblockables() to inspect each
row's reason during refresh, and LabelDiffUpdates queries by label via
parameterized JPQL.

Removing this dead helper eliminates both the unsafe native SQL pattern and
unnecessary maintenance surface; if composite-key lookups on
BsaUnblockableDomain are ever needed in the future, tm().loadByKeysIfPresent()
with BsaUnblockableDomain.vKey() or a static UNNEST query should be used
instead.

- Delete Queries.queryUnblockablesByNames() and its now-unused imports.
- Delete the corresponding unit tests and setup helper in QueriesTest.

BUG=http://b/529387728
@CydeWeys CydeWeys changed the title Parameterize BSA native SQL queries for SQLi safety Remove unused BSA native SQL query helper Dec 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant