Skip to content

Get-DbaHelpIndex - Fix SQL injection and remove SQL 2005 code path#10302

Merged
potatoqualitee merged 1 commit intodevelopmentfrom
claude/issue-8716-20260403-1400
Apr 4, 2026
Merged

Get-DbaHelpIndex - Fix SQL injection and remove SQL 2005 code path#10302
potatoqualitee merged 1 commit intodevelopmentfrom
claude/issue-8716-20260403-1400

Conversation

@andreasjordan
Copy link
Copy Markdown
Collaborator

Fixes #8716

  • Escape single quotes in ObjectName to prevent SQL injection when building the @TableName DECLARE/SET statement
  • Remove unused $SizesQuery2005 block and its conditional branching; Connect-DbaInstance -MinimumVersion 10 already enforces SQL 2008+
  • Update docs to reflect SQL Server 2008+ minimum version requirement

Generated with Claude Code

- Escape single quotes in ObjectName to prevent SQL injection when
  building the @TableName DECLARE/SET statement
- Remove unused $SizesQuery2005 block and its conditional branching;
  Connect-DbaInstance -MinimumVersion 10 already enforces SQL 2008+
- Update docs to reflect SQL Server 2008+ minimum version requirement

(do Get-DbaHelpIndex)

Co-authored-by: Andreas Jordan <andreasjordan@users.noreply.github.com>
@potatoqualitee potatoqualitee merged commit 1ab8d1f into development Apr 4, 2026
15 checks passed
@potatoqualitee potatoqualitee deleted the claude/issue-8716-20260403-1400 branch April 4, 2026 21:07
@potatoqualitee
Copy link
Copy Markdown
Member

Thank you 👍🏼

@potatoqualitee
Copy link
Copy Markdown
Member

Oh, and regarding SQL injection: this is CLI so I'm not convinced this is an issue. People do SQL injection on the web precisely to get to your CLI. With dbatools, we're already there.

Still, it's good coding practice and I'll be enforcing it in dbatools 3.0 bc it can be pretty.

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.

Get-DbaHelpIndex - SQL Injection And Remove Unused Code

2 participants