From owner-freebsd-current@freebsd.org Tue Jan 5 01:25:52 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34B1C4D316D for ; Tue, 5 Jan 2021 01:25:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D8vvg253Kz4mPk for ; Tue, 5 Jan 2021 01:25:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f43.google.com with SMTP id q25so27875119otn.10 for ; Mon, 04 Jan 2021 17:25:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=VgkW089MrW/nMLb3GtZEKMxvdJA007nWspyHccD4llU=; b=ozV6XvxOf3HLImILrslkZHJK1odIn8didAlC7tSsCb5mQaKLl8kkPaQYIoy3ph8jPJ XZakz+gPonK4hQG4mgRTf6mAeLNtlyLq5e141gSH1V+P3z56mBJZ/AMd9lFsv9hcAwh8 J3lKiOVQMsLCus4Qa3lILQjxIZr1FoQN9CUU2Xnczm4M6gBcjButwd9piSyEnbln3UGm /KJKy7IT+CmMxTAh2MbPOvp3AE9J4xR+EbaXzT3FMCdyZXn0ULg5ImGTLsnYgH2ELNKY /ej7c6tCoTVXfRDf+uJz91TQWnau7mzbhcKFsnxTgfsJhDA7t6Pq8KlClhkEfJNk0wGj 5UxQ== X-Gm-Message-State: AOAM530DdrwPiI4h9b3lypIluzbPWzPQwhxxtfCVXV1GaT8kj1ihVoMU PF2fl5ygeTKwFqv6AmUJUeNUamXuKeo= X-Google-Smtp-Source: ABdhPJzrEqyaUcKD/2e8+wdQ8gG/0McShz+yMPi8uFAqqU2/Ly236YPOLQ9ZMCwcJW3ZYK/9dEDJ0w== X-Received: by 2002:a05:6830:1bc6:: with SMTP id v6mr53265219ota.33.1609809949934; Mon, 04 Jan 2021 17:25:49 -0800 (PST) Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com. [209.85.167.173]) by smtp.gmail.com with ESMTPSA id g5sm14183669otq.43.2021.01.04.17.25.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jan 2021 17:25:49 -0800 (PST) Received: by mail-oi1-f173.google.com with SMTP id q25so34324453oij.10 for ; Mon, 04 Jan 2021 17:25:49 -0800 (PST) X-Received: by 2002:aca:e007:: with SMTP id x7mr1153188oig.8.1609809949541; Mon, 04 Jan 2021 17:25:49 -0800 (PST) MIME-Version: 1.0 References: <20201218182820.1P0tK%steffen@sdaoden.eu> <20201223023242.GG31099@funkthat.com> <20201223162417.v7Ce6%steffen@sdaoden.eu> <20201229011939.GU31099@funkthat.com> <20201229210454.Lh4y_%steffen@sdaoden.eu> <20201230004620.GB31099@funkthat.com> <20201231193908.GC31099@funkthat.com> <20210101165651.7319af5a@gumby.homeunix.com> <20210104193237.GD31099@funkthat.com> <95361.1609793029@critter.freebsd.dk> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 4 Jan 2021 17:25:38 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: HEADS UP: FreeBSD src repo transitioning to git this weekend To: Ryan Stone Cc: FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4D8vvg253Kz4mPk X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.00 / 15.00]; HAS_REPLYTO(0.00)[cem@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.210.43:from]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.210.43:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.210.43:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.43:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2021 01:25:52 -0000 On Mon, Jan 4, 2021 at 1:44 PM Ryan Stone wrote: > FWIW, a coworker of mine had a little hobby of introducing commits > into our internal repro that had hashes that all started with > deadc0de. As I understand it, it was able to do this by adding an > bogus attribute with the right value to the commit object. Yeah, the git commit object is essentially text with some headers, and the git tools are all permissive of unrecognized headers. You can create a "visually identical" commit (same commit message, parent commit(s), author/committer/dates, etc) by just adding an extra header with an arbitrary value and brute force on that value to find a vanity prefix. This isn't anything related to the SHA1 attacks, it's just brute-forcing the output of a truncated SHA1 to a 1-in-2^32 result. E.g., https://github.com/cemeyer/gitbrutec does it by injecting a header named "x-gitbrutec-nonce." $ git cat-file -p 0000009 tree 4e778673b8af45ecd4c62e8b1d1438d06db7f440 parent 00000080b4fc4c2066fa05641e73d5f0985c15ea author Conrad Meyer 1590357489 -0700 committer Conrad Meyer 1590357489 -0700 x-gitbrutec-nonce YYZSKGIQCLLXGE Use 'git update-ref' in post-commit example ... > Now, > brute-forcing 8 digits in the hash is one thing and doing it for all > 40 is quite another, but I suspect that this demonstrates that it's > *possible* to do it for a git hash, given enough computing resources. SHA1 has always, by design, been vulnerable to a 2^80 resource attack :-). Best, Conrad