BorrowSanitizer

Lobsters Hottest Tools

Summary

BorrowSanitizer is an open-source LLVM sanitizer for detecting Rust-specific aliasing violations in multi-language applications, aiming to be fast enough for fuzzing and to support Rust, C, and C++ interop.

<p><a href="https://lobste.rs/s/jkv2du/borrowsanitizer">Comments</a></p>
Original Article
View Cached Full Text

Cached at: 08/04/26, 11:45 AM

# Introduction - BorrowSanitizer Source: [https://borrowsanitizer.com/](https://borrowsanitizer.com/) > Check out our latest[status update](https://borrowsanitizer.com/status/latest)for 2026\! 👀 **BorrowSanitizer**is a dynamic analysis tool for detecting Rust\-specific aliasing bugs in multi\-language applications\. ![the BorrowSanitizer project logo](https://borrowsanitizer.com/images/bsan.svg) The Rust compiler provides powerful,*static*safety guarantees by restricting aliasing and mutability\. However, developers can bypass these restrictions by using a subset of[`unsafe`](https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html)features\. These features are necessary for Rust to interoperate with other languages\. However, if developers use unsafe code incorrectly, then they can break the rules of Rust’s aliasing model, which the compiler relies on to be able to optimize programs\. Incorrect optimizations can introduce security vulnerabilities\. Rust developers can find aliasing bugs using[Miri](https://github.com/rust-lang/miri), an interpreter\. Miri is**the only tool**that can find violations of Rust’s latest[Tree Borrows](https://www.ralfj.de/blog/2023/06/02/tree-borrows.html)aliasing model, but it cannot find these bugs in foreign code\. Miri is also significantly slower than native execution, which makes it impractical to use techniques like fuzzing or property\-based testing to find these Rust\-specific bugs\. BorrowSanitizer is an LLVM sanitizer for finding aliasing violations\. Our goal is for it to be fast enough for use with fuzzing tools and to have support for Rust, C, and C\+\+ in interoperation\. We intend for it to be a production\-ready tool\. Join[our Zulip](https://bsan.zulipchat.com/)if you are interested in contributing or if you have any additional questions about our project\. You can build and test our sanitizer by following the setup instructions in the next section\. All of our code is open\-source and publicly available[on GitHub](https://github.com/borrowsanitizer)\. [https://borrowsanitizer.com/setup.html](https://borrowsanitizer.com/setup.html) [https://borrowsanitizer.com/setup.html](https://borrowsanitizer.com/setup.html)

Similar Articles

you_can::turn_off_the_borrow_checker

Hacker News Top

Introduces a Rust macro that suppresses borrow checker errors for educational purposes, warning it is unsafe for production use.

Borrow-checking without type-checking

Lobsters Hottest

A blog post presents a toy language that enforces borrow-checking at runtime without static typing, using cheap reference-counting on the stack to enable interior pointers and single ownership in a dynamically-typed setting.

Cpp2Rust: Automatic Translation of C++ to Safe Rust

Lobsters Hottest

Cpp2Rust is an open-source tool that automatically translates C++ code to safe Rust using clang's AST and a runtime library, enabling safe memory-safe conversion with support for both safe and unsafe output modes.