Microsoft Finds Memory-Safety Bugs in Rust's Core Libraries Using AI Security Tools

Microsoft Finds Memory Safety Bugs in Rust Core Libraries

Microsoft Rust Security Research Uncovers Foundational Bugs

Microsoft's FORGE Lab has identified multiple memory-safety issues in Rust's standard libraries, including cases where programs written entirely in safe Rust can trigger undefined behavior.

The findings, published November 9, 2026, challenge the assumption that memory-safety guarantees eliminate every possible implementation weakness.

Researchers identified three recurring patterns behind the problems: unexpected program panics, incorrect assumptions about user-provided code, and unsafe interactions with operating-system state.

Microsoft used an AI-assisted vulnerability research system called Hyenas, a research version of codename MDASH, to help investigate some of the issues.

The researchers reported their findings to Rust maintainers, who have already addressed several problems.

Why Rust Is Considered a Secure Programming Language

Rust is designed to prevent many memory-safety problems that commonly affect languages such as C and C++.

For example, its ownership and borrowing rules help prevent invalid memory access.

These guarantees make Rust attractive for security-sensitive applications.

However, parts of Rust's standard library rely on unsafe code internally.

Such code can perform operations that the compiler cannot fully verify.

Consequently, developers maintaining these libraries must uphold the safety guarantees expected by applications using them.

How Microsoft Found the Vulnerabilities

Microsoft's FORGE Lab combined human security research with AI-assisted code analysis.

The researchers investigated how internal library functions behave under unusual conditions.

For example, a function may temporarily modify memory while assuming another operation will complete successfully.

However, if that operation unexpectedly panics, the program may leave memory in an invalid state.

The researchers demonstrated that some of these situations could be triggered through safe Rust code.

Nevertheless, a demonstration of undefined behavior does not automatically establish a remotely exploitable security vulnerability.

Three Major Patterns Identified

Vulnerability pattern

Underlying problem

Panic safety

Unexpected failures leave internal memory in an unsafe state

User-provided implementations

Library code assumes external implementations behave consistently

Operating-system interactions

Library code relies on system state that may change unexpectedly

One example involved the MapWindows::clone implementation.

Researchers found that a panic during cloning could cause the program to access uninitialized memory.

Another example involved string replacement behavior that could produce invalid UTF-8 under unusual conditions.

The researchers also investigated problems involving process termination and environment variables.

Why These Findings Matter

Rust is increasingly used in operating systems, browsers, developer tools, and infrastructure software.

Consequently, weaknesses in foundational libraries can have implications beyond a single application.

However, the practical risk depends on whether a real application can reach the vulnerable behavior.

Microsoft explicitly cautioned that some issues require unusual conditions.

For one process-exit issue, researchers assessed practical exploitation as unlikely under the conditions tested.

Therefore, the findings should not be interpreted as evidence that ordinary Rust applications are broadly compromised.

The Role of AI in Vulnerability Discovery

Microsoft's research highlights how AI can assist security specialists with complex code analysis.

For example, an AI-assisted tool can help investigate relationships between library functions and operating-system behavior.

This may allow researchers to explore issues that traditional automated analysis struggles to identify.

However, human validation remains essential.

Microsoft's researchers reproduced the bugs, evaluated their potential impact, and coordinated with maintainers.

What Developers Should Do

Developers should continue following Rust security advisories and maintaining supported toolchains.

Teams responsible for low-level libraries should pay particular attention to unsafe code.

Important practices include testing panic behavior, validating assumptions about external implementations, and reviewing interactions with operating-system APIs.

Additionally, organizations should avoid assuming that a language's security reputation removes the need for testing.

What's Next for Rust Security?

Microsoft says it will continue using AI-assisted vulnerability discovery to investigate foundational open-source projects.

Meanwhile, Rust maintainers will evaluate remaining issues and proposed fixes.

Two issues reported by the Microsoft team remained open when its research was published.

Ultimately, Microsoft's findings reinforce Rust's value while showing that strong language-level safety guarantees still depend on correct implementation of foundational libraries.

Frequently Asked Questions

Is Rust an unsafe programming language? No. Rust provides strong memory-safety guarantees, but implementation bugs can still occur.

What did Microsoft discover? Memory-safety issues involving unsafe code inside Rust's standard libraries.

Did AI discover all the vulnerabilities? No. Researchers combined AI-assisted analysis with manual investigation.

Are the bugs actively exploited? Microsoft's research does not establish active exploitation of the reported issues.

Have the problems been fixed? Several have been addressed, while some issues remained open at publication.