fix Failure to use HTTPS or SFTP URL in Maven artifact upload/download xen-api() #6429
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
xen-api/ocaml/sdk-gen/java/autogen/xen-api/pom.xml
Lines 74 to 78 in c5efca2
fix the problem, need to update the repository URLs in the
distributionManagement
section of thepom.xml
file to use HTTPS instead of HTTP. This change will ensure that artifacts are downloaded and uploaded over a secure protocol, mitigating the risk of MITM attacks.Specifically, we will:
repository
element fromhttp://oss.sonatype.org/content/repositories/java-net-releases/
tohttps://oss.sonatype.org/content/repositories/java-net-releases/
.snapshotRepository
element fromhttp://oss.sonatype.org/content/repositories/java-net-snapshots/
tohttps://oss.sonatype.org/content/repositories/java-net-snapshots/
.Using an insecure protocol like HTTP or FTP to download your dependencies leaves your Maven build vulnerable to a Man in the Middle (MITM). This can allow attackers to inject malicious code into the artifacts that you are resolving and infect build artifacts that are being produced. This can be used by attackers to perform a Supply chain attack against your project's users.
POC
These show of locations in Maven POM files where artifact repository upload/download is configured. The first shows the use of HTTP, the second shows the use of HTTPS.
References
Want to take over the Java ecosystem? All you need is a MITM!
How to take over the computer of any Java (or Closure or Scala) Developer.
mveytsman/dilettante
Announcing nohttp
HTTP Decommission Artifact Server Announcements
CWE-300
CWE-319
CWE-494
CWE-829