Skip to content

Trim user input before sending to detectSQLInjection#1048

Merged
bitterpanda63 merged 1 commit into
mainfrom
fix/trim-user-input-sql-injection
Jun 1, 2026
Merged

Trim user input before sending to detectSQLInjection#1048
bitterpanda63 merged 1 commit into
mainfrom
fix/trim-user-input-sql-injection

Conversation

@bitterpanda63

@bitterpanda63 bitterpanda63 commented Jun 1, 2026

Copy link
Copy Markdown
Member

Trims and normalizes user input before SQL injection detection, matching the fix applied to the Java firewall in AikidoSec/firewall-java#298.

Problem: An attacker can pad their payload with trailing whitespace (e.g. "payload "). If the DB driver trims this before execution, the SQL query won't contain the padded input, causing shouldReturnEarly to incorrectly return true (missed detection).

Fix: Apply .toLowerCase().trim() to the user input before both the early-return check and the WASM detection call.

See: AikidoSec/firewall-java#298

Summary by Aikido

Security Issues: 0 Quality Issues: 0 Resolved Issues: 0

🐛 Bugfixes

  • Normalized and trimmed user input before detection and early-return check

More info

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bitterpanda63 bitterpanda63 merged commit 4c63603 into main Jun 1, 2026
62 of 64 checks passed
@bitterpanda63 bitterpanda63 deleted the fix/trim-user-input-sql-injection branch June 1, 2026 12:55
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.

2 participants