Report forwarded
to maximedevos@telenet.be, attila@lendvai.name, guix-patches@gnu.org: bug#53608; Package guix-patches.
(Fri, 28 Jan 2022 17:33:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Ludovic Courtès <ludo@gnu.org>:
New bug report received and forwarded. Copy sent to maximedevos@telenet.be, attila@lendvai.name, guix-patches@gnu.org.
(Fri, 28 Jan 2022 17:33:02 GMT) (full text, mbox, link).
Subject: [PATCH 0/2] Rejecting commits unrelated to the introductory commit
Date: Fri, 28 Jan 2022 18:31:42 +0100
Hello!
This patch series fixes a bug in the checkout authentication code:
it would be possible to authenticate a commit unrelated to the
introductory commit, provided that target commit passes the
authorization invariant (see the commit log for details).
Users of Guix and of third-party channels are safe: this bug does
not have any impact on checkout authentication in those cases.
What concrete cases are affected? Suppose someone forks Guix and
publishes a new channel introduction for their fork. The expectation
is that any branch started before the introductory channel, for
instance in the original Guix repo, would fail to be authenticated.
However, because of this bug, such a branch would be considered
authentic in the fork because all its commits pass the authorization
invariant (IOW, they are authentic in the original repository).
Thoughts?
Ludo'.
Ludovic Courtès (2):
git: Add 'commit-descendant?'.
git-authenticate: Ensure the target is a descendant of the
introductory commit.
doc/guix.texi | 4 ++-
guix/git-authenticate.scm | 17 ++++++++--
guix/git.scm | 24 +++++++++++++-
tests/channels.scm | 60 +++++++++++++++++++++++++++++++++-
tests/git-authenticate.scm | 44 +++++++++++++++++++++++++
tests/git.scm | 52 ++++++++++++++++++++++++++++-
tests/guix-git-authenticate.sh | 17 ++++++++--
7 files changed, 210 insertions(+), 8 deletions(-)
base-commit: 5052f76afd02e27d6484acf74c86bfa1b6f9cd0e
--
2.34.0
Information forwarded
to guix-patches@gnu.org: bug#53608; Package guix-patches.
(Fri, 28 Jan 2022 17:44:02 GMT) (full text, mbox, link).
Cc: Attila Lendvai <attila@lendvai.name>, Maxime Devos <maximedevos@telenet.be>
Subject: Re: bug#53608: [PATCH 0/2] Rejecting commits unrelated to the
introductory commit
Date: Wed, 09 Feb 2022 00:02:11 +0100
Howdy Maxime & Attila,
Did you have a chance to look into this series?
https://issues.guix.gnu.org/53608
It’s relatively simple but I’d rather have other eyeballs looking at it.
TIA. :-)
Ludo’.
Ludovic Courtès <ludo@gnu.org> skribis:
> Hello!
>
> This patch series fixes a bug in the checkout authentication code:
> it would be possible to authenticate a commit unrelated to the
> introductory commit, provided that target commit passes the
> authorization invariant (see the commit log for details).
>
> Users of Guix and of third-party channels are safe: this bug does
> not have any impact on checkout authentication in those cases.
>
> What concrete cases are affected? Suppose someone forks Guix and
> publishes a new channel introduction for their fork. The expectation
> is that any branch started before the introductory channel, for
> instance in the original Guix repo, would fail to be authenticated.
> However, because of this bug, such a branch would be considered
> authentic in the fork because all its commits pass the authorization
> invariant (IOW, they are authentic in the original repository).
>
> Thoughts?
>
> Ludo'.
>
> Ludovic Courtès (2):
> git: Add 'commit-descendant?'.
> git-authenticate: Ensure the target is a descendant of the
> introductory commit.
>
> doc/guix.texi | 4 ++-
> guix/git-authenticate.scm | 17 ++++++++--
> guix/git.scm | 24 +++++++++++++-
> tests/channels.scm | 60 +++++++++++++++++++++++++++++++++-
> tests/git-authenticate.scm | 44 +++++++++++++++++++++++++
> tests/git.scm | 52 ++++++++++++++++++++++++++++-
> tests/guix-git-authenticate.sh | 17 ++++++++--
> 7 files changed, 210 insertions(+), 8 deletions(-)
>
>
> base-commit: 5052f76afd02e27d6484acf74c86bfa1b6f9cd0e
Information forwarded
to guix-patches@gnu.org: bug#53608; Package guix-patches.
(Thu, 10 Feb 2022 22:30:02 GMT) (full text, mbox, link).
Ludovic Courtès schreef op wo 09-02-2022 om 00:02 [+0100]:
> Howdy Maxime & Attila,
>
> Did you have a chance to look into this series?
>
> https://issues.guix.gnu.org/53608
>
> It’s relatively simple but I’d rather have other eyeballs looking at it.
>
> TIA. :-)
The concept seems reasonable to me but I cannot tell if the
implementation is good or bad.
Greetings,
Maxime.
Hi,
Maxime Devos <maximedevos@telenet.be> skribis:
> Ludovic Courtès schreef op wo 09-02-2022 om 00:02 [+0100]:
>> Howdy Maxime & Attila,
>>
>> Did you have a chance to look into this series?
>>
>> https://issues.guix.gnu.org/53608
>>
>> It’s relatively simple but I’d rather have other eyeballs looking at it.
>>
>> TIA. :-)
>
> The concept seems reasonable to me but I cannot tell if the
> implementation is good or bad.
OK.
I went ahead and pushed these two commits:
ca87601dd9 git-authenticate: Ensure the target is a descendant of the introductory commit.
87d49346f3 git: Add 'commit-descendant?'.
The actual change is this extra condition:
@@ -426,6 +428,17 @@ (define commits
(verify-introductory-commit repository keyring
start-commit signer))
+ ;; Make sure END-COMMIT is a descendant of START-COMMIT or of one of
+ ;; AUTHENTICATED-COMMITS, which are known to be descendants of
+ ;; START-COMMIT.
+ (unless (commit-descendant? end-commit
+ (cons start-commit
+ authenticated-commits))
+ (raise (formatted-message
+ (G_ "commit ~a is not a descendant of introductory commit ~a")
+ (oid->string (commit-id end-commit))
+ (oid->string (commit-id start-commit)))))
+
(let ((stats (call-with-progress-reporter reporter
(lambda (report)
I encourage everyone to take a look.
Thanks,
Ludo’.
bug closed, send any further explanations to
53608@debbugs.gnu.org and Ludovic Courtès <ludo@gnu.org>
Request was from Ludovic Courtès <ludo@gnu.org>
to control@debbugs.gnu.org.
(Mon, 14 Feb 2022 10:35:02 GMT) (full text, mbox, link).
bug archived.
Request was from Debbugs Internal Request <help-debbugs@gnu.org>
to internal_control@debbugs.gnu.org.
(Mon, 14 Mar 2022 11:24:05 GMT) (full text, mbox, link).
Debbugs is free software and licensed under the terms of the
GNU Public License version 2. The current version can be
obtained from https://bugs.debian.org/debbugs-source/.