Skip to content
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

Getting "Hard coded password found here" exception where (IMHO) it shouldn't #987

Open
sliric opened this issue Mar 4, 2024 · 6 comments

Comments

@sliric
Copy link

sliric commented Mar 4, 2024

Why I'm getting the Hard coded password found here exception here:

`
@value("${p12Name}")
private String p12Name;

@value("${p12Alias}")
private String p12Alias;

@value("${p12Password}")
private String p12Token;
.............
KeyStore keystore = KeyStore.getInstance("PKCS12");
keystore.load(
this.getClass().getClassLoader().getResourceAsStream(p12Name), p12Token.toCharArray());
PrivateKey key = (PrivateKey) keystore.getKey(p12Alias, p12Token.toCharArray());
`

I’m getting this error in the line ‘keystore.load(’.
SQ version is 9.9 (build 65466)

This is the screenshot of this problem:
image

@gtoison
Copy link
Contributor

gtoison commented Mar 4, 2024

Hello, this rule is from findsecbugs
Before you report the issue there can you please say which version of the plugin you're using? So I check what's the corresponding version of findsecbugs

@sliric
Copy link
Author

sliric commented Mar 4, 2024

Sorry @gtoison I cannot find plugins version in SonarQube, is this the maybe helpful:
image

@gtoison
Copy link
Contributor

gtoison commented Mar 4, 2024

The plugin version should be visible in SonarQube's marketplace page where all the plugins are visible (you need SonarQube admin rights to see that page I think)

@sliric
Copy link
Author

sliric commented Mar 5, 2024 via email

@gtoison
Copy link
Contributor

gtoison commented Mar 5, 2024

Thanks, it would be helpful to report the false positive on https://github.com/find-sec-bugs/find-sec-bugs/issues with a minimal code example reproducing the problem. The code sample you have posted does not have the imports, I guess these are Spring classes but it's not always obvious ;)

@sliric
Copy link
Author

sliric commented Mar 5, 2024

Ok, here it is => find-sec-bugs/find-sec-bugs#731

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

No branches or pull requests

2 participants