Option to disable local server path import #262

Closed
opened 2025-11-02 03:16:23 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @rugk on GitHub (Jan 22, 2017).

In the migration settings it is stated that also local server paths can be migrated! It explicitly states local server paths.

So, but, ... why should I want it!?
When you provide a public Gitea instance this might mean that anyone could import any locally stored git repo or so.

Generally it is a bad idea to allow any (potentially malicious) user to access any local server files, which they can request. Fortunately /etc is usually not git repo, otherwise they could have accessed /etc/passwd too.

So at least make that thing configurable, but I also recommend you to deactivate it by default. Who needs such a strange feature anyway?


upstream issue: https://github.com/gogits/gogs/issues/4033

Originally created by @rugk on GitHub (Jan 22, 2017). In the migration settings it is stated that also **local server paths** can be migrated! It explicitly states **local** server paths. So, but, ... why should I want it!? When you provide a public Gitea instance this might mean that anyone could import any locally stored git repo or so. Generally it is a bad idea to allow any (potentially malicious) user to access any local server files, which they can request. Fortunately `/etc` is usually not git repo, otherwise they could have accessed `/etc/passwd` too. So at least make that thing configurable, but I also recommend you to deactivate it by default. Who needs such a strange feature anyway? ---- upstream issue: https://github.com/gogits/gogs/issues/4033
GiteaMirror added the type/enhancement label 2025-11-02 03:16:23 -06:00
Author
Owner

@tboerger commented on GitHub (Jan 23, 2017):

The local import is anyway only allowed for admins or users that got this specific permission.

@tboerger commented on GitHub (Jan 23, 2017): The local import is anyway only allowed for admins or users that got this specific permission.
Author
Owner

@dchest commented on GitHub (Jan 23, 2017):

Please reconsider: admin of Gitea instance (or another user having permission to do local import) is not equivalent to admin of the server on which it runs.

It also opens an attack vector — by gaining access to Gitea admin account it may be possible to get access to other resources on the server (e.g. /etc directory in etckeeper is mentioned in the gogs issue thread if's accessible to user running Gitea instance).

This should be properly handled as a security issue, with published notification about it, etc.

@dchest commented on GitHub (Jan 23, 2017): Please reconsider: admin of Gitea instance (or another user having permission to do local import) is not equivalent to admin of the server on which it runs. It also opens an attack vector — by gaining access to Gitea admin account it may be possible to get access to other resources on the server (e.g. /etc directory in etckeeper is mentioned in the gogs issue thread if's accessible to user running Gitea instance). This should be properly handled as a security issue, with published notification about it, etc.
Author
Owner

@tboerger commented on GitHub (Jan 24, 2017):

But it's still an working as expected feature. But a pr to add an option to disable it have been merged to master.

@tboerger commented on GitHub (Jan 24, 2017): But it's still an working as expected feature. But a pr to add an option to disable it have been merged to master.
Author
Owner

@rugk commented on GitHub (Feb 10, 2017):

see https://github.com/go-gitea/gitea/issues/898

@rugk commented on GitHub (Feb 10, 2017): see https://github.com/go-gitea/gitea/issues/898
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#262