apache / apache/maven-artifact-plugin

compare: untrusted reference.repo URL echoed unquoted into wget hint

Open Beginner friendly
#250 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
14
Forks
23
Avg merge
1h 27m
Merged PRs (30d)
8

Description

`CompareMojo.diffoscope()` (lines 306-326) reflects user-controlled and artifact-derived data into a `wget` hint printed to the build log:

```java
String url = baseUrl
+ (baseUrl.endsWith("/") ? "" : "/")
+ session.getRepositorySession()
.getLocalRepositoryManager()
.getPathForRemoteArtifact(a, repo, null);
return "wget " + url + "; ls -l " + relative(actual);
```

`baseUrl` comes from the user-provided `reference.repo` parameter; the path is derived from the current artifacts. While the plugin only prints this string (it does not shell-execute it), the echoed value is attacker-influenced during a build of untrusted projects and can be used to spoof/mislead the suggestions a user copy-pastes. Worth sanitizing or explicitly quoting the URL in the hint to avoid confusing/ambiguous instructions.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at CompareMojo.diffoscope() in the lines 306-326, where the reference.repo value and artifact-derived path are assembled into the wget hint. Decide on quoting or sanitization that prevents ambiguous copy-paste instructions while preserving the intended hint, then verify that the generated output is unambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.