Skip to content

security(connector): return validated identifiers to break JDBC taint edge - #53

Merged
lekhrocks merged 1 commit into
mainfrom
fix/connector-taint-guard
Aug 7, 2026
Merged

security(connector): return validated identifiers to break JDBC taint edge#53
lekhrocks merged 1 commit into
mainfrom
fix/connector-taint-guard

Conversation

@lekhrocks

Copy link
Copy Markdown
Owner

Summary

Follow-up to PR #52 (already merged): make the JDBC metadata identifier guard visible to static taint analysis.

Change

AbstractJdbcMetadataConnector.requireIdentifier now returns the validated identifier, and each metadata method reassigns its schema/table parameter from it (schema = requireIdentifier(schema, "schema")).

Previously the guard only validated (void return), which a static taint scanner couldn't see through — it flagged the raw schema/table parameters flowing into DatabaseMetaData.getPrimaryKeys/getColumns/etc. By rebinding the parameter to the validator's output, the value passed to the JDBC call is explicitly the sanitized value, not the user input. Same rejection rules: [A-Za-z_][A-Za-z0-9_$]*.

Applied to all five JDBC-metadata methods: fetchColumns, fetchTables, fetchIndexes, fetchPrimaryKey, fetchForeignKeys.

Verification

  • ./gradlew :syncflow-connectors:compileJava clean
  • ./gradlew :syncflow-api:test :syncflow-connectors:test pass
  • Integration tests (-Dtests.integration=true, Testcontainers) pass

… edge

requireIdentifier now returns the validated value and each metadata method
reassigns its schema/table parameter from it, so the value passed to JDBC
metadata calls is the validator's output rather than the raw user input.
This makes the sanitization explicit to static taint analysis (the previous
void-guard wasn't visible to it) while preserving the same rejection rules.
@lekhrocks
lekhrocks merged commit f2e628f into main Aug 7, 2026
7 checks passed
@lekhrocks
lekhrocks deleted the fix/connector-taint-guard branch August 7, 2026 13:02
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