2 bookmarks for 2025-12-30

812.

The Compiler Is Your Best Friend, Stop Lying to It - Daniel Beskin's Blog

blog.daniel-beskin.com/2025-12-22-the-compiler-is-your-best-friend-stop-lying-to-it

The text discusses the importance of compilers in software development, highlighting their role in translating source code into machine code. It compares the compilers of different programming languages, such as Rust and Java, emphasizing their unique features and functionalities. The text also touches upon the concept of self-hosting compilers and the bootstrapping process.

The text explores the role of compilers and type systems in programming languages, particularly focusing on TypeScript. It highlights the benefits of gradual typing and structural typing for dynamically typed languages like JavaScript. The author argues that developers often “lie” to compilers by not providing accurate information about nullability, exceptions, and type casting, limiting the compiler’s usefulness.

The text emphasizes the importance of communicating effectively with the compiler to improve code safety and maintainability. It highlights common practices like using null, exceptions, casting, and side-effects, which can mislead the compiler and hinder its usefulness. By adopting alternative approaches like using Option types for nullable values, Result types for exceptions, and sealed types for casting, developers can make their intentions clearer to the compiler. Additionally, separating pure computation from side-effects and using typed wrappers for concepts can further enhance the compiler’s ability to assist in code development.

The text emphasizes the importance of using union types and other sophisticated types to express invariants and guarantees in code. By modelling alternative states and encoding constraints as types, the compiler can enforce these rules, reducing the need for defensive programming and improving code reliability. This approach, exemplified by the Google Cloud outage incident, helps developers avoid null pointer exceptions and other runtime errors by making illegal states unrepresentable.

811.

MongoBleed explained simply

bigdata.2minutestreaming.com/p/mongobleed-explained-simply

MongoBleed (CVE-2025-14847) is a critical vulnerability in MongoDB’s zlib1 message compression path, affecting versions since 2017. It allows attackers to read uninitialized heap memory, potentially exposing sensitive data like passwords and API keys. The exploit involves sending a false uncompressed size, causing the server to allocate excessive memory, and then exploiting BSON parsing to leak data.

A vulnerability in MongoDB’s zlib network compression allows attackers to read arbitrary heap data, including sensitive information, from publicly accessible databases. The vulnerability, present since 2017, was patched in December 2025 but not publicly disclosed until December 24th. While MongoDB claims no evidence of exploitation, the simplicity of the exploit and the number of exposed databases suggest otherwise.

Online comments suggest that exposing a database to the public warrants consequences.