Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon

Mozilla engineer shares the implications of rewriting browser internals in Rust

Save for later
  • 2 min read
  • 01 Mar 2019

article-image

Yesterday, Diane Hosfelt, a Research Engineer at Mozilla, shared what she and her team experienced when rewriting Firefox internals in Rust. Taking Quantum CSS as a case study, she touched upon the potential security vulnerabilities that could have been prevented if it was written in Rust from the very beginning.

Why Mozilla decided to rewrite Firefox internal in Rust?


Quantum CSS is a part of Mozilla’s Project Quantum, under which it is rewriting Firefox internals to make it faster. One of the major parts of this project is Servo, an engine designed to provide better concurrency and parallelism. To achieve these goals Mozilla decided to rewrite Servo in Rust, replacing C++. Rust is very similar to C++ in some ways while being different in terms of the abstractions and data structures it uses. It was created by Mozilla keeping concurrency safety in mind. Its type and memory-safe property make programs written in Rust thread-safe.

What type of bugs does Rust prevent?


Overall Rust prevents bugs related to memory, bounds, null/uninitialized variables, or integer by default. Hosfelt mentioned in her blog post, “Due to the overlap between memory safety violations and security-related bugs, we can say that Rust code should result in fewer critical CVEs (Common Vulnerabilities and Exposures).” However, there are some types of bugs that Rust does not address like correctness bugs.

According to Hosfelt, Rust is a good option in the following cases:

  • When your program involves processing of untrusted input safely
  • Unlock access to the largest independent learning library in Tech for FREE!
    Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
    Renews at £16.99/month. Cancel anytime
  • When you want to use parallelism for better performance
  • When you are integrating isolated components into an existing codebase


You can go through the blog post by Diane Hosfelt on Mozilla’s website.

Mozilla shares key takeaways from the Design Tools survey

Mozilla partners with Scroll to understand consumer attitudes for an ad-free experience on the web

Mozilla partners with Ubisoft to Clever-Commit its code, an artificial intelligence assisted assistant