• Bug#1103833: rust-protobuf: CVE-2024-7254

    From Salvatore Bonaccorso@21:1/5 to All on Mon Apr 21 20:20:02 2025
    U291cmNlOiBydXN0LXByb3RvYnVmClZlcnNpb246IDIuMjcuMS0xClNldmVyaXR5OiBpbXBvcnRh bnQKVGFnczogc2VjdXJpdHkgdXBzdHJlYW0KRm9yd2FyZGVkOiBodHRwczovL2dpdGh1Yi5jb20v c3RlcGFuY2hlZy9ydXN0LXByb3RvYnVmL2lzc3Vlcy83NDkKWC1EZWJidWdzLUNjOiBjYXJuaWxA ZGViaWFuLm9yZywgRGViaWFuIFNlY3VyaXR5IFRlYW0gPHRlYW1Ac2VjdXJpdHkuZGViaWFuLm9y Zz4KCkhpLAoKVGhlIGZvbGxvd2luZyB2dWxuZXJhYmlsaXR5IHdhcyBwdWJsaXNoZWQgZm9yIHJ1 c3QtcHJvdG9idWYuCgpDVkUtMjAyNC03MjU0WzBdOgp8IEFueSBwcm9qZWN0IHRoYXQgcGFyc2Vz IHVudHJ1c3RlZCBQcm90b2NvbCBCdWZmZXJzIGRhdGHCoGNvbnRhaW5pbmcKfCBhbiBhcmJpdHJh cnkgbnVtYmVyIG9mIG5lc3RlZCBncm91cHMgLyBzZXJpZXMgb2YgU0dST1VQwqB0YWdzIGNhbgp8 IGNvcnJ1cHRlZCBieSBleGNlZWRpbmcgdGhlIHN0YWNrIGxpbWl0IGkuZS4gU3RhY2tPdmVyZmxv dy4gUGFyc2luZwp8IG5lc3RlZCBncm91cHMgYXMgdW5rbm93biBmaWVsZHMgd2l0aCBEaXNjYXJk VW5rbm93bkZpZWxkc1BhcnNlciBvcgp8IEphdmEgUHJvdG9idWYgTGl0ZSBwYXJzZXIsIG9yIGFn YWluc3QgUHJvdG9idWYgbWFwIGZpZWxkcywgY3JlYXRlcwp8IHVuYm91bmRlZCByZWN1cnNpb25z IHRoYXQgY2FuIGJlIGFidXNlZCBieSBhbiBhdHRhY2tlci4KCgpJZiB5b3UgZml4IHRoZSB2dWxu ZXJhYmlsaXR5IHBsZWFzZSBhbHNvIG1ha2Ugc3VyZSB0byBpbmNsdWRlIHRoZQpDVkUgKENvbW1v biBWdWxuZXJhYmlsaXRpZXMgJiBFeHBvc3VyZXMpIGlkIGluIHlvdXIgY2hhbmdlbG9nIGVudHJ5 LgoKRm9yIGZ1cnRoZXIgaW5mb3JtYXRpb24gc2VlOgoKWzBdIGh0dHBzOi8vc2VjdXJpdHktdHJh Y2tlci5kZWJpYW4ub3JnL3RyYWNrZXIvQ1ZFLTIwMjQtNzI1NAogICAgaHR0cHM6Ly93d3cuY3Zl Lm9yZy9DVkVSZWNvcmQ/aWQ9Q1ZFLTIwMjQtNzI1NApbMV0gaHR0cHM6Ly9naXRodWIuY29tL3N0 ZXBhbmNoZWcvcnVzdC1wcm90b2J1Zi9pc3N1ZXMvNzQ5ClsyXSBodHRwczovL3J1c3RzZWMub3Jn L2Fkdmlzb3JpZXMvUlVTVFNFQy0yMDI0LTA0MzcuaHRtbAoKUmVnYXJkcywKU2FsdmF0b3JlCg==

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From NoisyCoil@21:1/5 to All on Fri Apr 25 03:10:01 2025
    Source: rust-protobuf
    Followup-For: Bug #1103833
    X-Debbugs-Cc: noisycoil@tutanota.com, jelmer@debian.org, infinity0@debian.org, dr@jones.dk
    Control: forwarded -1 https://github.com/stepancheg/rust-protobuf/issues/763

    I looked into this, I will try to summarize the situation to the best of my knowledge.

    CVE-2024-7254 was fixed in rust-protobuf 3.7.2, but testing ships 2.27.1 and the fix was not backported to v2. An informal backport request was made in [1], a backport commit was proposed in [2] but ignored, and earlier today I filed
    a more formal backport request in [3] explaining our position.

    As usual we have 3 ways to fix this: backport, remove, update.


    * Backporting

    As I said above, no official backport is currently available. The developer who proposed [2] does not seem to be entirely sure about why one test is not failing in the first place and the proposal was not reviewed. I'm not personally going down this route because I'm not knowledgeable enough about Protocol Buffers to attempt fixing a CVE that affects how parsing is implemented. But if someone is able to take a shot at this, this is probably the best solution. Also, maybe [3] will receive an answer, who knows?


    * Removing

    Static-Built-Using and company [4] say there are only 3 applications in
    testing built against rust-protobuf:

    - erbium (maintainer: Jelmer Vernooij <jelmer@debian.org>, popcon: 1)
    - protobuf-codegen (maintainer: Ximin Luo <infinity0@debian.org>, popcon: 40)
    - scaphandre (maintainer: Jonas Smedegaard <dr@jones.dk>, popcon: 22)

    Their maintainers are cc'ed to this email. I did not investigate whether the dependency on rust-protobuf can be patched out for these.

    According to codesearch, the full (r)dependency tree is:

    - rust-protobuf-codegen (leaf + library, rdeps below)
    - rust-protobuf-codegen-pure (rdeps below)
    - rust-protoc-rust (no rdeps, essentially unmaintained, can be removed)
    - rust-pprof (pending autoremoval, Rust Team already wants to see it gone)
    - rust-handlebars (only tests depend on pprof, has many rdeps, cannot be
    removed, needs decoupling)
    - rust-prometheus
    - rust-erbium-core
    - rust-erbium (leaf, no rdeps)
    - rust-opendal (no rdeps, never in testing, can be removed)
    - rust-ttrpc (no rdeps)
    - scaphandre (leaf, no rdeps)

    Library-wise, it seems many of these packages can already be removed. But we must hear from the applications' maintainers before going down this route [5].


    * Updating

    Updating requires 2 transitions: rust-prometheus is currently at v0.13, but only v0.14 is compatible with protobuf 3. Porting prometheus to protobuf 3 seems to be non trivial: it was done in [6] with a +1400,-1500 LOC PR. Thus in addition to updating the toplevel crates in the list above -- a draft for which is kinda complete in [7] -- we should also update prometheus' rdeps -- namely, rust-erbium-core and rust-opendal (but the latter could just be removed). Note that the version of rust-protobuf-codegen that goes with the fixed version of rust-protobuf (3.7.2) requires a package not in Debian: rust-protobuf-parse.
    So to update we would not only need an unblock for a full transition and a semver-breaking update/small transition, but also an unblock from NEW (the package is not even in NEW yet, to be clear). Clearly this is the least feasible option, only motivated by the high-severity CVE (score: 8.7) if there is a strong need to keep the three applications above, no way to decouple them from the insecure behavior in rust-protobuf and no way to backport the fix.


    Cheers!


    [1] https://github.com/stepancheg/rust-protobuf/pull/756#issuecomment-2710162444
    [2] https://github.com/stepancheg/rust-protobuf/pull/756#issuecomment-2715961002
    [3] https://github.com/stepancheg/rust-protobuf/issues/763
    [4] `grep-dctrl -s Package -F Static-Built-Using,X-Cargo-Built-Using rust-protobuf /var/lib/apt/lists/*Packages | sort -u`
    [5] I understand based on recent history Ximin Luo may not answer.
    [6] https://github.com/tikv/rust-prometheus/pull/541
    [7] https://salsa.debian.org/rust-team/debcargo-conf/-/merge_requests/896

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jonas Smedegaard@21:1/5 to All on Fri Apr 25 07:10:01 2025
    Quoting NoisyCoil (2025-04-25 03:02:57)
    - scaphandre (leaf, no rdeps)

    Scaphande is now (pending upload) patched to no longer build-depend on
    the protobuf crate. Turns out it was optional and already unused for
    other reasons (will file a bug about that upstream).

    Thanks!

    - Jonas

    --
    * Jonas Smedegaard - idealist & Internet-arkitekt
    * Tlf.: +45 40843136 Website: http://dr.jones.dk/
    * Sponsorship: https://ko-fi.com/drjones

    [x] quote me freely [ ] ask before reusing [ ] keep private

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From NoisyCoil@21:1/5 to All on Wed Apr 30 11:20:01 2025
    Because of this bug, rust-protobuf is now marked for autoremoval
    together with the following packages:

    rust-erbium, rust-erbium-core, rust-pprof, rust-prometheus, rust-protobuf-codegen, rust-protobuf-codegen-pure, rust-protoc-rust, rust-ttrpc, scaphandre.

    scaphandre was already decoupled from it, the autoremoval should be
    avoided once it migrates to testing (5 more days). As for the others,
    neither erbium's maintainer nor the Rust Team for protobuf-codegen
    showed interest in preventing their removal, and I'm not familiar enough
    with these programs to make a decision, so I'll leave this bug hanging.
    Options to prevent them from being removed are discussed in the present bug.

    Cheers!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)