-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix S2068 FN: add support for SecureString #7323
Comments
See also this comment from the research ticket:
Hint: DE0001 is a rule provided by the .Net platform team. There is no need to reimplement it. |
In the investigation ticket, there is an advice about the scope of the change:
We should ignore the constructor and the other modification methods. It is not worth investing too much in a deprecated API. |
The rule is about a data flow of a constant string, which is deconstructed into its characters and passed to SecureString.AppendChar. While it could be implemented via symbolic execution, there are some problems with this:
|
I think SE is not needed to detect this. Using
|
Why
We are working to improve the detection of issues in the Juliet benchmark. It heavily relies on
SecureString
for a lot of its tests.There currently are 284 FNs that relate to hardcoded passwords (S2068) and use
SecureString.AppendChar(char c)
. Therefore, we want to make sure that methods usingSecureString
with a constant value are correctly detected.Detection Logic
An issue should be triggered if
SecureString.AppendChar(char c)
is called with a hardcodedchar
. Since this method only accepts onechar
, an issue should also be raised ifc
is one character of a hardcoded string instead (see Example.)Example
Sensitive
(This example is copied from the Juliet benchmark)
Compliant
The text was updated successfully, but these errors were encountered: