Code analysis scanning flags false positive #76371
Replies: 1 comment
-
|
This is a classic false positive case in static code analysis — the tool flagged a security issue simply because the word "password" appeared in the code, not because any sensitive data was actually being logged or mishandled. Breakdown of the False Positive Tool Behavior: It likely matched: Why This Is a False Positive: The purpose of the script is to generate and show passwords — this is the intended behavior. There is no incoming user-sensitive data being leaked or stored insecurely. Contrast with the False Negative URL: This is concerning. The scanner: Suggested Fixes & Advice
Option A: Use code comments codeql [clear-text-logging]: false positive – this is a password generator, not real credentialsprint("Generated password:", password) Go to the Code scanning alert in GitHub. Click “Dismiss alert”. Choose “False positive”, and write a justification (like: "Password is generated, not real user data").
Add logic like:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Show & Tell
Body
The code security analysis shows I have this alert : Clear-text logging of sensitive information in this repository: MIT_AI.ME/CyberSecurity/Secure Password Generator/Password_Generator.py. but it is a false positive as the algorithm just recognized the word password, but there was really no password in there.
The one application that had the secret key showed for educational purposes was not flagged and came out as clean false negative: https://github.com/privateboss0/Artificial_Intelligence_MIT/tree/goddevil/MIT_AI.ME/CyberSecurity/Multifactor%20Authentication.
Please kindly tune the algorithm a bit more to detect these use cases.
Beta Was this translation helpful? Give feedback.
All reactions