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

Clear text cred display in mirror settings #672

Closed
2 of 6 tasks
handnot2 opened this issue Jan 14, 2017 · 8 comments
Closed
2 of 6 tasks

Clear text cred display in mirror settings #672

handnot2 opened this issue Jan 14, 2017 · 8 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality

Comments

@handnot2
Copy link

handnot2 commented Jan 14, 2017

  • Gitea version (or commit ref): 1.0.1
  • Git version:
  • Operating system: Debian Jesse arm
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Create a mirror of a private repo by providing the GIT URL and credentials at the top of the
Mirror Settings section. Once the mirror is created, the page
(Settings > Mirror Settings > Mirror Address) shows the credential in clear (https://user:passwd@host:port/repo..).

It is better to remove this mirror address display. If it is still needed, at the least mask the password.

@bkcsoft
Copy link
Member

bkcsoft commented Jan 14, 2017

Just using net/url doing the following should suffice (Pseudo-code, variables might be off, here be dragons)

// scheme://[userinfo@]host/path[?query][#fragment]
url, err := url.Parse(repo.MirrorAddress)
// err-check
url.User = nil
ctx.Data["MirrorAddress"] = url.String()

Ref: https://golang.org/pkg/net/url/#URL.String

if u.User is nil, userinfo@ is omitted.

@bkcsoft
Copy link
Member

bkcsoft commented Jan 14, 2017

You can also (if you want to see that auth is used) do the following to show https://******@example.com/foobar.git

if url.User {
  url.User = url.User(`********`)
}

Ref: https://golang.org/pkg/net/url/#User

@tboerger
Copy link
Member

IMHO this is not a real security issue because it's anyway only visible to repo admins. Beside that just replacing or wiping credentials without any workaround makes it impossible to update the settings without retyping the credentials over and over again.

@tboerger tboerger added the type/enhancement An improvement of existing functionality label Jan 16, 2017
@tboerger tboerger added this to the 1.x.x milestone Jan 16, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Jan 16, 2017

@tboerger to me it feels like a "over-the-shoulder" security issue, which IMO should be fixed. Though showing and editing doesn't have to be the same "box"

@stale
Copy link

stale bot commented Feb 17, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added issue/stale and removed issue/stale labels Feb 17, 2019
@stale
Copy link

stale bot commented Apr 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Apr 21, 2019
@stale
Copy link

stale bot commented May 5, 2019

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale stale bot closed this as completed May 5, 2019
@lunny lunny reopened this May 5, 2019
@stale stale bot removed the issue/stale label May 5, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label May 5, 2019
@mrsdizzie
Copy link
Member

Fixed in #7651

@lunny lunny removed this from the 1.x.x milestone Sep 8, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

5 participants