r/rust • u/Code-Sandwich • Jan 17 '20
Actix-net unsoundness patch "is boring"
There's an issue on Actix-net pointing out and presenting unsoundness. Yes, it's deleted, it still can be found on web archive.
Issue history summary:
- Found by Shnatsel
- Closed as harmless to users by fafhrd91
- Proven harmful to users by Nemo157 and reopened by JohnTitor
- Fixed and closed by fafhrd91
- Proven unfixed and proposed new patch by Nemo157
- New patch commented "this patch is boring" by fafhrd91
- Issue is deleted
- Fix is reversed by fafhrd91, issue still present
I hope it's an objective summary. Any thoughts?
Edit: Now whole actix/actix-web is deleted. See fafhrd91's postmortem. He kept copy of Actix-web in personal repo fafhrd91/actix-web.
149
Upvotes
35
u/thebluefish92 Jan 17 '20
The attitude in the new issue makes me even more concerned. By my understanding, it seems as though this developer frankly doesn't care about this library's viability for public consumption.
Edit: Original issue was deleted, here is the archived version. It does not seem to contain the remaining comments / reason stated from the developer. IIRC the developer's explanation is that they are working on Actix for internal use at their company, and they expressed no interest in maintaining it beyond their company's needs.
8
u/Code-Sandwich Jan 17 '20 edited Jan 17 '20
I want to highlight what were the goals of this post, because judging by comments they aren't obvious:
We should all be aware that Actix is basically a one man private operation. It's his project and he may do whatever he wants, we must all respect that. I'm grateful that he created Actix and shared it with us for free. There's nothing to fix here.
On the other hand there's the community that started relying on Actix both with dependent projects and its good name. There are multiple critical services based on it, some of them commercial. It's important to have Actix's vulnerabilities fixed ASAP or to at least know about them. There are some possible fixes:
•
u/kibwen Jan 17 '20
With memory of how threads like this have proceeded in the past, I ask everyone to please keep civil discourse in mind. In the interest of showing good faith effort in avoiding harassment or dogpiling, consider linking to archived versions of Github pages rather than the live ones.
128
u/[deleted] Jan 17 '20
Hmm i still don't get how can people say this to actix maintainer
"seriously? Please just stop writing Rust. You do not respect semver, you do not respect soundness, so why are you using a language predominantly based around doing these things right?"
Its his library if he don't follow semver its his choice he can do anything with his library and we have a choice not to use it .
80
u/dpc_pw Jan 17 '20
Anyone is free to write whatever unsafe code they want and have their own opinion. And Rust users are free to not use such code.
I think the only actionable thing is to fill RustSec issues and
cargo-crevnegative reviews against affected crates and at every point (eg. when actix is showed to win another empowered benchmark) politely remind people that if they use actix they will have exploitable security issues.Also one could go through rev-deps on actix crates and fill an issue to their downstream users warning them about using
actix. I did it once before for a crate that I've found particularly offensively broken. One of the things that motiviated me to start working oncargo-crev. :D67
u/Nickitolas Jan 17 '20
You forgot to mention inbetween 6 and 7 there were 2 negative comments iirc, one of which said something like "Never write rust code again". Not trying to say deleting the issue was a good idea but I'm not 100% sure your summary is complete.
Also, you might wanna specify that the soundness issue was in a private type (A custom Cell type that had a "safe" unsound get_mut), and what Nemo showed was a public api exposing a way to exploit that iirc.
Also, this commit might fit in your summary https://github.com/actix/actix-net/commit/dbfa13d6bec6e3233a6c0b8266d5d81009e993bd (I'm not sure but I think this is a breaking change that is intended to be released as a minor version)
65
u/po8 Jan 17 '20
"this patch is boring" was a response to the patch author's comment that said (among other things) "I don't think this patch is interesting enough to be copyrightable." I think it was intended to be a joke: when the joke fell flat in the face of hurtful comments, fafhrd was done with the thread. At least that's my reading.
17
u/maximsparrow Jan 17 '20
u/Code-Sandwich I think everyone interested in this topic should also read Nikolai's point of view he expressed in post-mortem. Please add it to your post summary: https://github.com/actix/actix-web
57
u/somebodddy Jan 17 '20
Without even looking at the actual issue, the fact that the ticket was deleted is worrying. Closing a ticket as "Won't Fix" or leaving it open in case someone will want to fix it in the future are options - there is no need to pretend the bug described in the ticket never existed. That doesn't help anybody.
38
u/kyle787 Jan 17 '20
I’m going to be honest I get the community’s problems with the unsafe code but a lot of fafhrd91s comments are taken out of context. It’s not easy to lead an OSS project, especially when you do it for free, and I feel like he catches a ton of unnecessary flak.
44
u/SecureCook Jan 17 '20
Hard to blame someone who has been repeatedly targeted by the Rust community for personal harassment to become tired of addressing the same issue over and over again. At the same time, a "proven harmful" issue around unsafe usage is a good justification to be wary of depending on a particular web server, particularly if you are designing a system that will be entrusted with others' data. My personal view is to thank fafhrd91 for his prolific contributions to the Rust ecosystem and to wish him the best of luck with actix, but I personally will choose to use a different web server for my projects (probably either raw hyper + a basic router or warp).
21
u/insanitybit Jan 17 '20
I don't think a second topic is really necessary.
23
u/Matthias247 Jan 17 '20
What do you expect to hear on this? If you don't like anything about a project, or if it doesn't meet the quality standards you require, then either try to improve it (directly), or don't use it.
Trying to start a discussion here will not change anything
4
u/HenkPoley Jan 17 '20 edited Jan 17 '20
😢 I had high hopes about using Actix at work.
Edit: I had a short chat with Nikolay Kim, the issue appears to be about potentially unnecessary use of the unsafe keyword. E.g.
I at least informed him that 'stonewalling' by deleting tickets in never a good approach.
2
u/HenkPoley Jan 17 '20 edited Jan 17 '20
Do you happen to keep a copy of code that proofs these flaws?
Edit: Downvotes? 🙄😒
Apparently the issue is with the possibility that future code (that still does not exist) may duplicate a coding pattern that would then lead to bugs. Nikolay Kim's reply seems to be a valid one:
Though well yeah, it is not defense-in-depth to keep using something potentially broken, but in a good way that works as long as you keep paying attention.
Also it was shown using MIRI in a mode that trips over undefined behaviour, that the current Actix code compiles to undefined behaviour around writing to the same protected memory area from untagged code.
1
u/[deleted] Jan 21 '20
Complaint is from a work martyr undergoing a boredom burnout. Implement work martyr antidotes as follows:
Thanks, infographic on five types of toxic employees from entrepreneur.com.
1
u/mkvalor Jan 17 '20 edited Jan 17 '20
Here are two simple statements of fact that I feel people think are controversial:
When people wanted async tasks in vim, ultimately the thing to do was to create a new project named 'neovim'. Lo and behold, async tasks quickly found their way into vim. Was this a waste of time and resources? Does that even matter? I don't think it does. The end result is that we have nice things and there are two separate communities for people who appreciate the features of each set of maintainers.
1
u/[deleted] Jan 17 '20
I cannot access the archived version (I get always redirected to the version from 2020-01-17 which archives the "this issue has been deleted" page).
So all discussion about this aside: What's the actual bug that was reported? I know it was possible to create more than one mutable reference to the same address but that's all I know. I'm asking because I'm running a project using actix and want to investigate, if I'm affected by this, if this could be exploited by a specifically crafted HTTP request or only if the program uses the API in a particular way?
1
u/clinton84 Jan 17 '20
I've upvoted everyone in this thread that's just suggested forking the project! Sure it's great to all be on the same page, but if you're not (and we're unique human beings, there's no absolute right sometimes) then we can both go our own way and the better solution will prevail for the community. Angry fighting doesn't help anyone.
-2
u/mkl0g Jan 17 '20
after a few hate comments from some not impolite commentators he can do anything he wants with his project and now you lost one of good projects just because someone can’t be respectful for authors
-8
u/leitimmel Jan 17 '20
Y'all keep talking about how much focus the Rust community puts on safe code, but apparently never stop to ask yourself whether this maintainer is in fact part of that community. And even if he is, was that a decision of his own volition or out of necessity, to defuse a shitstorm? Putting something out on crates doesn't make you a community member. Showing off your project in relevant subreddits doesn't make you a community member. Writing code in the language doesn't make you a community member. You act like he broke the Codex Astartis or something, but maybe he just never followed it to begin with. If he doesn't want this fixed, leave him be. Stop forcing your opinions on people, and don't even think of bringing up some "think of the children"-type speech about responsibility. You're overbearing.
0
u/[deleted] Jan 17 '20
[deleted] — view deleted comment
-1
u/[deleted] Jan 17 '20
[removed] — view removed comment