Skip to content
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

Passwords exposed with git.remote.origin.url when HTTPS URIs are userd #240

Closed
damnhandy opened this issue Mar 22, 2016 · 2 comments
Closed

Comments

@damnhandy
Copy link
Contributor

In my pom.xml I have the following defined in my SCM config:

<properties>
    <project.scm.id>my-git-id</project.scm.id>
</properties>

<url>https://myprivate.git.host/gitrepo</url>
<scm>
    <url>https://myprivate.git.host/gitrepo.git</url>
    <connection>scm:git:https://myprivate.git.host/gitrepo.git</connection>
    <developerConnection>scm:git:https://myprivate.git.host/gitrepo</developerConnection>
</scm>

Note, username and password are not present in the SCM URIs. However, when using the Maven release plugin, the value of the git.remote.origin.url is as follows:

git.remote.origin.url=https://user\:password@myprivate.git.host/gitrepo.git

That value file is being published to our internal Artifactory host. This only seems to be reproducible when running mvn release:prepare followed by mvn release:perform. Oddly, typical goals such as package and install don't include the user info. Additionally, the mvn deploy goal also does not include the user info section in the property. This appears to be related to the Maven Release Plugin somehow, but I do have a PR that fixes this issue with this plugin.

@damnhandy
Copy link
Contributor Author

I have also created a test case that demonstrates the issue under 2.2.0 here:

https://github.com/damnhandy/maven-publish-issue

You'll need Docker Compose to run it, but clearly demonstrates the issue. The underlying cause is likely the Maven Release plugin, which apparently includes the credentials in the URI but also manages to temporarily overwrite the origin URI to include the username and password. My PR fixes the issue.

@ktoso
Copy link
Collaborator

ktoso commented Mar 26, 2016

Thanks for noticing this, I'll review now - seems like something we'll want to include and would be enough to cut a release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants