Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix B608 to detect VALUES( without space#1337

Merged
ericwb merged 1 commit intoPyCQA:mainfrom
kfess:update/injection-sql
Nov 30, 2025
Merged

Fix B608 to detect VALUES( without space#1337
ericwb merged 1 commit intoPyCQA:mainfrom
kfess:update/injection-sql

Conversation

Copy link
Contributor

kfess commented Nov 29, 2025

The current regex pattern for INSERT statements requires a whitespace character after VALUES,
but VALUES( is valid SQL syntax and commonly used.
This causes potential SQL injection cases to go undetected.

Changed the regex from values\s to values[\s(] to match both VALUES ( and VALUES( patterns.

Resolves: #1336

kfess requested review from ericwb, lukehinds and sigmavirus24 as code owners November 29, 2025 05:32
The current regex pattern for INSERT statements requires a whitespace
character after VALUES, but VALUES( is valid SQL syntax and commonly
used. This causes potential SQL injection cases to go undetected.

Changed the regex from `values\s` to `values[\s(]` to match both
`VALUES (` and `VALUES(` patterns.

Resolves: PyCQA#1336
kfess force-pushed the update/injection-sql branch from 87f58ad to 832cb26 Compare November 29, 2025 05:34
sigmavirus24 approved these changes Nov 29, 2025
ericwb approved these changes Nov 30, 2025
ericwb merged commit 3c56109 into PyCQA:main Nov 30, 2025
15 checks passed
github-actions bot mentioned this pull request Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

sigmavirus24 sigmavirus24 approved these changes

ericwb ericwb approved these changes

lukehinds Awaiting requested review from lukehinds lukehinds is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

B608: Missing detection for VALUES( without space in SQL injection check

3 participants