Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[Gendarme] New Security rule: SqlCommandShouldUseNamedParameters #32

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

knocte
Copy link
Contributor

@knocte knocte commented Mar 1, 2013

This rule will report failures on source code prone to SQL injection
attacks.

It includes basic tests that cover SqlCommand usage via
constructor and CommandText property.

Contributed under the MIT/X11 licence.

@spouliot
Copy link
Contributor

I do not recall [TestCase ("CallsSqlCommandCtorWithVariableString")] being supported by Mono's supplied version of NUnit.Framework. Do it works out-of-the-box with 3.0.x ? (I need to check on another box)

@knocte
Copy link
Contributor Author

knocte commented Apr 29, 2013

Oh, you're right, TestCase() is only available in NUnit 2.5 or newer, and in Mono's NUnit (2.4.8) it errors out with:

test.cs(11,4): error CS0616: `NUnit.Framework.TestCase': is not an attribute class

So I'll change the PR to not use it.

This rule will report failures on source code prone to SQL injection
attacks.

It includes basic tests that cover SqlCommand usage via
constructor and CommandText property.

Contributed under the MIT/X11 licence.
I don't work for Novell anymore
@knocte
Copy link
Contributor Author

knocte commented May 17, 2013

Fixed!

@knocte
Copy link
Contributor Author

knocte commented Nov 28, 2013

ping :)

@knocte
Copy link
Contributor Author

knocte commented Mar 19, 2014

@spouliot ping

@knocte
Copy link
Contributor Author

knocte commented Jul 2, 2015

ping...

@maobulang
Copy link

how to get the rule, i can not find the rule in source code.

@knocte
Copy link
Contributor Author

knocte commented Sep 1, 2015

@rosslight it has not been merged yet, you can extract the patch from here and apply it manually: https://github.com/mono/mono-tools/pull/32/files

@maobulang
Copy link

@knocte thanks.

Base automatically changed from master to main March 1, 2021 15:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants