-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Hardening suggestions for Stirling-PDF / certValidate #2395
Conversation
@@ -44,14 +45,14 @@ private void loadMozillaCertificates() throws Exception { | |||
boolean inCert = false; | |||
int certCount = 0; | |||
|
|||
while ((line = reader.readLine()) != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced with a call that offers an upper bound on the number of characters that will be read before giving up and throwing a security exception
if (line.startsWith("CKA_VALUE MULTILINE_OCTAL")) { | ||
inCert = true; | ||
certData = new StringBuilder(); | ||
continue; | ||
} | ||
if (inCert) { | ||
if (line.equals("END")) { | ||
if ("END".equals(line)) { | ||
inCert = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch order of literals to prevent NullPointerException
91fd35f
to
558a83f
Compare
558a83f
to
720e57f
Compare
* verifyCerts * cert info * Hardening suggestions for Stirling-PDF / certValidate (#2395) * Protect `readLine()` against DoS * Switch order of literals to prevent NullPointerException --------- Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com> * some basic html excaping and translation fixing --------- Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com> Co-authored-by: a <a>
I've reviewed the recently opened PR (2394 - PDF Cert validation) and have identified some area(s) that could benefit from additional hardening measures.
These changes should help prevent potential security vulnerabilities and improve overall code quality.
Thank you for your consideration!
🧚🤖 Powered by Pixeebot
Feedback | Community | Docs