mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
Resolve code security vulnerabilities #503
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dombroskyk on GitHub (Apr 3, 2023).
Is your feature request related to a problem? Please describe.
Apologies if anything is out of place, this is my first time filing one of these.
My team is attempting to utilize WireMock.Net as a part of our unit tests and in our local dev environments it's worked great! Unfortunately once we merge the changes and trigger a build in our DevOps pipeline it causes a failure in a "dependency-check-build-task@6" typed task in the Azure pipeline. I believe it just performs a static security scan of the code and looks for possible vulnerabilities in dependencies.
Here's the list of failures it output from a run against version 1.5.21:
shell.openExternalwas used without checking the URL. This vulnerability allows an attacker to execute code on the victims machine by sending messages containing links with arbitrary protocols. The victim has to interact with the link and sees the URL that is opened. The issue was patched by implementing a helper function which checks if the URL's protocol is common. If it is common, the URL will be opened externally. If not, the URL will not be opened and a warning appears for the user informing them that a probably insecure URL was blocked from being executed. The issue is patched in Wire 3.20.x. More technical details about exploitation are available in the linked advisory.Describe the solution you'd like
It would give us peace of mind and provide long term ease of use if it passed the static scan by resolving the security vulnerabilities above.
Describe alternatives you've considered
Additional context
N/A
@StefH commented on GitHub (Apr 4, 2023):
@dombroskyk
The only reference to any WireMock is:
WireMock before 2.16.0 contains a vulnerability that allows a remote unauthenticated attacker to access local files beyond the application directory via a specially crafted XML request, aka Directory Traversal.But this is the JAVA version, not this .NET version.
So for now I'm closing this issue.
@dombroskyk commented on GitHub (Apr 4, 2023):
Good call, apologies. Upon a deeper dive into the code behind the build task it was fuzzy matching onto the java versions and including them in the report for .net, and the tool even says it's prone to such in the fine print. I was able to successfully suppress the false-positives and have a happy pipeline again.