-
Notifications
You must be signed in to change notification settings - Fork 24
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
Improve Error Messages related to data flows from forbidden types #224
Comments
Hey Lonzak, We totally agree CogniCrypt's error messages could do with some improvement. Thanks for raising this issue here. That said, I want to mention two things.
This is not to say, there is nothing to be done about the way it is being reported currently, even now. I'll be leaving this issue open for suggestions on how to improve this particular error message. If you have any suggestions on how to rephrase it, please let us know. |
Regarding (1): Ok maybe I didn't see or find that suggestion. Where can I see it? I tried a right click on the error but there is no sub-menu. I also didn't find a CogniCrypt view or perspective. Maybe you can point me in the right direction? Let me make an example. E.g. Spotbugs reports:
So far so good. But what is the problem with that? Without any information I would not fix that problem and just ignore it. That is why this short bug info is followed by an explanation:
Ah nice - now I know where, why and how I can improve my code and if I have the time I am gonna do it.
Why is using Let me show what what do I mean with the help of an example:CogniCrypt NOW: Operation on object of type java.security.MessageDigest object not completed. Expected call to digest, update [sic] CogniCrypt IMPROVED: In the analyzed code there are potential code paths which could result in not calling one of the below mentioned methods. Please verify the number of calls and ensure that their ordering is correct.
And if you are really nice you also tell abour your limitations here: Please note, that cryptSL currently can not detect update(...) calls within loops. (more information here on False-Positives)
|
Nice work so far! CogiCrypt is quite helpful but in certain aspects some improvements can be done.
In general most of the error message have to be improved. For instance the following code
triggers the following error:
Ok. What exactly does it mean? The password was originally a string. ok. But how can it be fixed? What can go wrong if I use Strings in the first place? One thing is to detect security related bugs, misuses etc. But the other thing is to educate and to help developers improve.
The sonar guys have done it quite nicely:
https://rules.sonarsource.com/java/type/Vulnerability/RSPEC-4426
The text was updated successfully, but these errors were encountered: