You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3d9904a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(java): add SQL-injection sinks for full Spring R2DBC + io.r2dbc.spi coverage (#216)
Fixes the false-negative reported in github/field-security-codeql#231 for
Spring R2DBC's DatabaseClient.sql(Supplier<String>) pattern, and extends the
fix to full, TDD-validated coverage of both affected data extensions.
org.springframework.r2dbc.model.yml:
- Previously only DatabaseClient.GenericExecuteSpec.fetch() was modeled as a
sink, missing then()/map()/mapValue()/mapProperties()/flatMap() terminal
methods and the bind*/filter fluent methods that carry the tainted SQL
through the chain.
- Added 6 sinkModel rows (then, map(Function), map(BiFunction), mapValue,
mapProperties, flatMap) and 9 summaryModel rows (bind x2, bindNull x2,
bindValues x2, bindProperties, filter x2) so every method on
GenericExecuteSpec that can reach or carry the deferred SQL is covered.
io.r2dbc.spi.model.yml:
- Added 4 new sinkModel rows found during a full audit of the driver-agnostic
R2DBC SPI: Connection.createSavepoint(String), releaseSavepoint(String),
rollbackTransactionToSavepoint(String), and
Statement.returnGeneratedValues(String...). Each takes a raw
identifier/column name that real drivers (verified against
r2dbc-postgresql 1.0.2.RELEASE) splice unescaped into the executed SQL
text (e.g. String.format("SAVEPOINT %s", name)), since the wire protocol
has no parameter placeholder for identifiers.
Every one of the 16 Spring R2DBC rows and 6 io.r2dbc.spi rows now has a
dedicated, empirically-verified test proving it fires - not just
architectural reasoning by analogy. Two real bugs were caught and fixed
during this process: a corrupted .expected file (accidental copy of the
view tool's line-number prefixes) and a test-stub structural bug
(StatementFilterFunction needing to be a top-level type, not nested inside
DatabaseClient, to match the real Spring API and the model's fully-qualified
signature string).
Full CWE-089/spring-r2dbc test suite passes cleanly; broader CWE-089 suite
run shows only pre-existing, unrelated MyBatis failures caused by a missing
external stub checkout path in this environment.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f02ef23b-e35d-4536-bd58-f2fbc2976ba9
0 commit comments