fix: validate session variable assignments by WikiRik · Pull Request #18290 · sequelize/sequelize · GitHub
Skip to content

fix: validate session variable assignments - #18290

Merged
WikiRik merged 2 commits into
v6from
backport/18272-v6
Aug 29, 2026
Merged

fix: validate session variable assignments#18290
WikiRik merged 2 commits into
v6from
backport/18272-v6

Conversation

@WikiRik

@WikiRik WikiRik commented Jul 29, 2026

Copy link
Copy Markdown
Member

Backport of #18272 to v6.

sequelize.set() builds its SET statement by interpolating both keys and values directly. Values now go through the normal escaping path, and names are validated against the 1-64 character unquoted user-variable grammar.

Added unit coverage for the generated SQL and integration coverage for the round-trip.

Also pins pg-native to 3.7.0 on the Node 10 legs of the Postgres matrix. 3.8.0 uses ??, which Node 10 cannot parse, so requiring it throws a SyntaxError before any test runs. This is unrelated to the backport and was already failing on v6.

List of Breaking Changes

Quoted user-variable names, such as `my var`, 'x', or "x", are now rejected. Use an unquoted name matching the supported grammar.

🤖 Generated with Claude Code

Backport of #18272 to v6.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

pg-native 3.8.0 uses `??`, which Node 10 cannot parse, so requiring it
throws a SyntaxError before any test runs. Node 18 keeps using the
current release.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@WikiRik
WikiRik enabled auto-merge (squash) July 29, 2026 13:27
@WikiRik

WikiRik commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

@denyspakizh-tob what do you think about this PR?

@WikiRik
WikiRik disabled auto-merge July 29, 2026 18:04
@WikiRik WikiRik added the v6 label Jul 29, 2026
WikiRik pushed a commit that referenced this pull request Jul 29, 2026
pg-native 3.8.0 uses `??`, which Node 10 cannot parse, so requiring it throws a
SyntaxError before any test runs. Pin the last release Node 10 can load and
keep newer Node versions on the current one.

Ported from #18290 so that the backport there stays limited to its own change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@denyspakizh-tob

Copy link
Copy Markdown
Contributor

@SippieCup SippieCup left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@WikiRik
WikiRik merged commit 52fd34f into v6 Aug 29, 2026
58 of 60 checks passed
@WikiRik
WikiRik deleted the backport/18272-v6 branch August 29, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants