Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add security advistory for fast-float. #2107

Merged
merged 1 commit into from
Nov 9, 2024
Merged

Conversation

Alexhuszagh
Copy link
Contributor

fast-float is currently unmaintained and contains undefined behavior in checking the length of the input aldanor/fast-float-rust#28. Although a patch was implemented and merged, no release was published and there has been no communication by the author in over 3 years.

In addition, there's also potential unsoundness, due to the use of many functions that are non-local safety guarantees marked as safe, assuming the necessary safety guarantees have been met by the caller. The simplest example is in AsciiStr::first, however, this is widely used through the repository:

impl<'a> AsciiStr<'a> {
    #[inline]
    pub fn first(&self) -> u8 {
        unsafe { *self.ptr }
    }
}

I've created a fork that publishes the patches for the undefined behavior and also removes the general unsoundness:

@Alexhuszagh Alexhuszagh marked this pull request as draft October 31, 2024 17:24
@Alexhuszagh Alexhuszagh marked this pull request as ready for review October 31, 2024 17:25
@Alexhuszagh Alexhuszagh force-pushed the fastfloat branch 2 times, most recently from 147d7c2 to 8869ff1 Compare October 31, 2024 19:05
@Shnatsel
Copy link
Member

Shnatsel commented Nov 9, 2024

Sorry it took a while to get to. Everything here looks good to me. Thank you for publishing a patched fork and filing an advisory!

@Shnatsel Shnatsel merged commit ce21893 into rustsec:main Nov 9, 2024
1 check passed
@Alexhuszagh Alexhuszagh deleted the fastfloat branch November 10, 2024 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants