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

Enable authentication against a disabled remote #12913

Conversation

AbrilRBS
Copy link
Member

@AbrilRBS AbrilRBS commented Jan 17, 2023

Changelog: Fix: Enable authentication against disabled remotes.
Docs: Omit

There's no need to force a remote to be enabled for it to be able to be authenticated against, as disabling a remote should only affect if they are used for dependency resolving
Part 1 of 2 for #12909

@prince-chrismc
Copy link
Contributor

Test code please :) 🙏

@AbrilRBS
Copy link
Member Author

Yes! Sorry @prince-chrismc I didn't leave a message in the PR. Got into a rabbit-hole while writing tests for this PR which turned into #12915 and it delayed them a bit, but I've got them now, thanks for noticing :)

@prince-chrismc
Copy link
Contributor

Usage makes sense 👍

@memsharded memsharded added this to the 2.0.0-beta9 milestone Jan 17, 2023
@memsharded
Copy link
Member

memsharded commented Jan 17, 2023

Just a quick note, this doesn't fully close #12909 (but it will be automatically closed when this is merged, because of the comment above). The missing bit is the conan remote list displaying all remotes.

Copy link
Contributor

@franramirez688 franramirez688 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good! For me, it's only missing a new test to check that we're really listing both remotes now. Good job! 👍

conan/cli/commands/remote.py Show resolved Hide resolved
@SSE4
Copy link
Contributor

SSE4 commented Jan 18, 2023

that looks suspicious. if remote is disabled, then no traffic should be sent to/from it. why does conan need to authenticate against explicitly disabled remote in the first place? seems to be a security issue IMO.

@memsharded
Copy link
Member

that looks suspicious. if remote is disabled, then no traffic should be sent to/from it. why does conan need to authenticate against explicitly disabled remote in the first place? seems to be a security issue IMO.

This works only for the explicit conan remote login command. If the user is actively issuing a command, why would be a security issue? Why requesting the user to conan remote enable + conan remote login + conan remote disable? It looks good.

@SSE4
Copy link
Contributor

SSE4 commented Jan 18, 2023

This works only for the explicit conan remote login command. If the user is actively issuing a command, why would be a security issue? Why requesting the user to conan remote enable + conan remote login + conan remote disable? It looks good.

that might be exploited via similarly looking remote names, like similar characters or just minor typos in words.
e.g. good luck distinguishing conan from сonan or conаn. and in this case, you can easily send your credentials to the wrong remote, so they will be stolen or leaked. very easy to exploit via simple social engineering by sending a bit differently looking commands.
if user decided to disable remote, it should remain to be disabled IMO, it was disabled for reason, and it should be respected.

@memsharded
Copy link
Member

that might be exploited via similarly looking remote names, like similar characters or just minor typos in words.
e.g. good look distinguishing conan from сonan or conаn. and in this case, you can easily send your credentials to the wrong remote, so they will be stolen or leaked. very easy to exploit via simple social engineering by sending a bit differently looking commands.

All of that can already happen with enabled remotes, if you add some remote to your existing remotes and that remote is malicious, then good luck, I don't think not allowing the authenticate for the reason it is disabled will save you from anything. conan remote disable cannot be a security measurement, it was always decided to avoid fetching packages from it, not as a security thing, as it doesn't make sense from the security point of view.

@memsharded memsharded merged commit 9038cae into conan-io:develop2 Jan 18, 2023
@AbrilRBS AbrilRBS deleted the rr/feature/authenticate-against-disabled-remote-12909 branch January 18, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants