A security audit of Git
For this portion of the research a total of 35 issues were discovered, including 2 critical severity findings and a high severity finding. Additionally, because of this research, a number of potentially catastrophic security bugs were discovered and resolved internally by the git security team.
See the
full report for all the details.
Posted Jan 25, 2023 10:40 UTC (Wed)
by moltonel (guest, #45207)
[Link] (7 responses)
Posted Jan 25, 2023 15:46 UTC (Wed)
by wtarreau (subscriber, #51152)
[Link] (6 responses)
Posted Jan 25, 2023 17:53 UTC (Wed)
by moltonel (guest, #45207)
[Link] (4 responses)
Posted Jan 26, 2023 13:21 UTC (Thu)
by wtarreau (subscriber, #51152)
[Link] (3 responses)
Posted Jan 26, 2023 17:30 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link]
Posted Jan 29, 2023 0:23 UTC (Sun)
by ms-tg (subscriber, #89231)
[Link] (1 responses)
Posted Jan 29, 2023 21:01 UTC (Sun)
by moltonel (guest, #45207)
[Link]
Rust often nudges you towards using compatible integer types instead of casting, or towards explicit arithmetic, like `saturating_sub()`. You'd be using iterators instead of a manual end-of-string check. Less wheels to reinvent in each project: that C `strbuf_split_buf()` looks suspiciously like Rust's various `split()` methods, perhaps with a `.owned()` in the chain if you really needs owned strings instead of references (often not needed in Rust, due to str not needing a null terminator). Things like `malloc()`ing a buffer and `memcpy()`ing too much data into it just doesn't happen in normal Rust: you just grab a `Vec<u8>`, with enough preallocated space if you have that info, and then `.extend()` it with your source data as a slice.
Posted Jan 25, 2023 18:12 UTC (Wed)
by MrWim (subscriber, #47432)
[Link]
> Git is a distributed version control system that allows developers to collaborate on software development. It is integrated into popular packaging systems, including Golang modules, Rust cargo, and NodeJS NPM.
I believe cargo uses libgit2 (via the git2 crate) rather than the git command line[^1]. So I don't think this report helps harden cargo.
Relatedly: the rust foundation are currently sponsoring @Byron[2] to replace the use of libgit2 with gitoxide[3] in cargo[4]. gitoxide is a reimplementation of git in rust. It's my favourite RIIR[^5] project. It's being implemented with great focus on correctness and speed - with some very impressive benchmarks[6]. @Byron publishes a progress report on github every month, which is great for following along with the project. Here's a 2022 retrospective[7].
[^1]: Unless you specify `git-fetch-with-cli = true`
Posted Feb 1, 2023 13:11 UTC (Wed)
by smammy (subscriber, #120874)
[Link]
A security audit of Git
A security audit of Git
A security audit of Git
A security audit of Git
A security audit of Git
A security audit of Git
A security audit of Git
I didn't read the C git code very closely, so it's possible that it does something complex that also wouldn't be straightforward in Rust, but from a quick look, idiomatic Rust would work well here and be safe.
A security audit of Git
[2]: https://github.com/Byron/
[3]: https://github.com/Byron/gitoxide/
[4]: https://github.com/rust-lang/cargo/pull/11448
[^5]: Rewrite it in Rust
[6]: https://github.com/Byron/gitoxide/discussions/579
[6]: https://github.com/Byron/gitoxide/discussions/681
A security audit of Git