Comments (5)
I suggest that you go ahead with making the advisory contribution, and @ssbr can collaborate there as/if desired.
I have opened rustsec/advisory-db#2027 for this.
from gitoxide.
Thanks for bringing this up!
It was quite a hack to begin with and I don't recall why it had to be kstring
here. And even though small-string optimisation should be possible, it definitely shouldn't be traded for safety.
Edit: I looked into this more and the idea was that it parses as zero-copy, but then typically converts to owned instances at some point. This is definitely where non-UTF8 could be exposed to places where UTF8 is expected.
from gitoxide.
It's worth noting that without kstring
, there is a 5% performance loss for an attribute-matching heavy workload. For now I replaced it with BString
, but hope to get to try a SmallVec implementation as well.
❯ hyperfine "/Users/byron/dev/github.com/Byron/gitoxide/target/release/gix index entries ':(attr:export-ignore)' -i" "gix index entries ':(attr:export-ignore)' -i"
Benchmark 1: /Users/byron/dev/github.com/Byron/gitoxide/target/release/gix index entries ':(attr:export-ignore)' -i
Time (mean ± σ): 820.1 ms ± 71.7 ms [User: 759.9 ms, System: 85.9 ms]
Range (min … max): 778.8 ms … 984.3 ms 10 runs
Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
Benchmark 2: gix index entries ':(attr:export-ignore)' -i
Time (mean ± σ): 782.1 ms ± 1.8 ms [User: 760.1 ms, System: 43.2 ms]
Range (min … max): 780.0 ms … 786.0 ms 10 runs
Summary
gix index entries ':(attr:export-ignore)' -i ran
1.05 ± 0.09 times faster than /Users/byron/dev/github.com/Byron/gitoxide/target/release/gix index entries ':(attr:export-ignore)' -i
from gitoxide.
I recommend that an informational RUSTSEC advisory be created to document that gix-attributes
was unsound--as described in this issue--prior to version 0.22.3.
This will help to notify interested users that they may wish to upgrade, and is part of what the RUSTSEC database tracks:
RustSec also tracks soundness issues as informational advisories, independent of whether they are vulnerabilities or not. A soundness issue arises when using a crate from safe code can cause Undefined Behavior.
This can be done by opening a pull request on the advisory-db repository in accordance with these instructions (which apply to informational advisories as well as those documenting vulnerabilities).
@ssbr I would be happy to contribute this. But I wanted to check with you first in case you want to do it. If not, I'll go ahead and open a PR and, unless you think it should be done differently, I would use text you wrote in this issue description and credit you in a Co-authored-by:
trailer in the commit message.
from gitoxide.
Thanks for bringing this up, I think it's the right call, too.
I suggest that you go ahead with making the advisory contribution, and @ssbr can collaborate there as/if desired.
from gitoxide.
Related Issues (20)
- `gix clean -xde` deletes the repo's own hidden nested worktrees, but they are not really hidden HOT 5
- The 32-bit Windows releases are 64-bit HOT 6
- Unclear intent regarding optimizations for some profiles HOT 5
- Prebuilt binaries obtained on ARM64 macOS are x86-64 HOT 5
- OSS-Fuzz issue 70841 HOT 1
- OSS-Fuzz issue 70863 HOT 1
- Release workflow relies on deprecated `set-output` feature
- OSS-Fuzz issue 70876 HOT 1
- `from_path_no_follow` test runs `touch` with nonportable date format HOT 3
- Panic when parsing `HEAD:README` in a repo with invalid HEAD. HOT 2
- gitx-credentials fails to build HOT 4
- copy detection differs from git weirdly HOT 12
- progress.rs misleadingly claims "we target 32bit systems only" HOT 6
- CVE-2024-43785: gitoxide-core does not neutralize special characters for terminals HOT 10
- gix-object v0.44.0 fail to compile HOT 2
- gitoxide is still less lenient than git when parsing signatures, in particular in tags
- gix clone fails on https://git.zx2c4.com/sha256-oid-test HOT 1
- Oxidize `git-cliff` HOT 2
- Unable to fetch with only extra_refspecs HOT 1
- Add a `tokio` feature HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitoxide.