google/wuffs
View on GitHub ↗ ★ 4,874 C
Wrangling Untrusted File Formats Safely
121 mentions on Hacker News by 76 people: 18 stories, 103 comments · first 2017-11-16 · latest 2026-10-29
20082026
-
…compiler to prove the addition wouldn’t overflow. Wuffs is specialized enough to do exactly that ( https://github.com/google/wuffs ).
comment by Sesse__ · 2022-12-07 · in Fast midpoint between two integers without overflow -
That's how WUFFS (Wrangling Untrusted File Formats Safely) works: https://github.com/google/wuffs#what-does-compile-time-check...
comment by nigeltao · 2022-11-30 · in How much does Rust's bounds checking cost? -
…Wuffs, a language focused on writing safe file format handlers (parsing, encoding, decoding) https://github.com/google/wuffs
comment by throwaway484 · 2022-11-26 · in Mangle, a programming language for deductive database programming -
…panics on this line In WUFFS foo[k] doesn't compile, variable k is the wrong type for indexing foo. https://github.com/google/wuffs/blob/main/doc/wuffs-the-lang... Now, WUFFS is not a general purpose programming language. You should not…
comment by tialaramex · 2022-11-06 · in Two years of fiddling with Rust -
There might be a few others. https://github.com/google/wuffs for example isn't general purpose or mainstream, but it's meant to solve practical problems, so I don't think I'd call it a research language. Opinions may vary.
comment by scottlamb · 2022-11-06 · in Two years of fiddling with Rust -
Here's another SIMD implementation, with commentary: https://github.com/google/wuffs/blob/main/std/adler32/common... Like the fpng implementation, it's SSE (128-bit registers), but the inner loop eats 32 bytes at a time, not 16. "Wuffs’…
comment by nigeltao · 2022-08-08 · in Computing Adler32 Checksums at 41 GB/s -
> Programing languages require precedence rules WUFFS doesn't have operator precedence. https://github.com/google/wuffs/blob/main/doc/wuffs-the-lang... As its designers explain: A bare a * b + c is an invalid expression. You must…
comment by tialaramex · 2022-08-07 · in Ivy – An interpreter for an APL-like language -
[WUFFS]( https://github.com/google/wuffs ) is made for stuff like this, and it has a library available as transpiled C code.
comment by SAI_Peregrinus · 2022-07-31 · in New Ghostscript PDF interpreter -
…should never happen as a result of processing a PDF. This is the purpose of languages like WUFFS: https://github.com/google/wuffs You can't write a WUFFS program to, for example, email anything to crooks@example.com even if you desperately…
comment by tialaramex · 2022-07-06 · in A fake job offer took down Axie Infinity -
This sort of stuff is where Iterate Loops are good: https://github.com/google/wuffs/blob/main/doc/note/iterate-l... WUFFS wants this because it demands all the checking at compile time (WUFFS code with a potential buffer overflow just…
comment by tialaramex · 2022-06-28 · in tolower() in bulk at speed -
…aimed at efficiently and safely parsing document structure. There is a PNG decoder [2]. 1. https://github.com/google/wuffs 2. https://news.ycombinator.com/item?id=26714831
comment by tgv · 2022-06-27 · in Pure: A static analysis file format checker -
…targeting these specific problems; that they'd consider Rust isn't just because "it's there". [1] https://github.com/google/wuffs
comment by riwsky · 2022-06-22 · in Experimenting with Rust in Chromium -
…unrolled loops nicely is a nice performance-not-safety feature of WUFFS called "Iterate loops": https://github.com/google/wuffs/blob/main/doc/note/iterate-l... Well, I say performance not safety, as always they want both, but you could…
comment by tialaramex · 2022-06-16 · in How fast can a 6502 transfer memory? -
For anyone curious: https://github.com/google/wuffs
comment by eru · 2022-06-13 · in Data Race Patterns in Go -
Wuffs[1] is an alternative that also supports generating the binary file. [1] https://github.com/google/wuffs
comment by janjones · 2022-04-03 · in Kaitai, binary format parsing web IDE -
Indeed, you should be Wrangling Untrusted File Formats Safely https://github.com/google/wuffs
comment by tialaramex · 2022-03-31 · in Lapsus$ and SolarWinds hackers both use the same old trick to bypass MFA -
I agree that it's similar but ultimately different problems. Copy/pasting from https://github.com/google/wuffs/blob/main/doc/related-work.m... gives: > Kaitai Struct is in a similar space, generating safe parsers for multiple target…
comment by nigeltao · 2022-03-18 · in Kaitai Struct: A new way to develop parsers for binary structures -
…and fast programming language made by Google specifically for decoding and encoding file formats https://github.com/google/wuffs Paired with C FFI available in most languages, this seems like the nicer solution. It's simpler than…
comment by kangalioo · 2022-03-17 · in Kaitai Struct: A new way to develop parsers for binary structures -
…even in principle express the programs that should not exist, that's exactly what WUFFS is for. https://github.com/google/wuffs This sort of bug can't happen in WUFFS because you can't express the idea "corrupt the heap memory" even if you…
comment by tialaramex · 2022-03-04 · in Heap memory corruption in GitHub's Markdown table parsing extension -
…I think, but am not sure, this is what the experimental parsing language 'wuffs' is about https://github.com/google/wuffs -- the language itself is aware of array lengths as a first-class citizen and can make decisions accordingly
comment by awinter-py · 2021-12-23 · in Three Minor Features in Go 1.18 -
https://github.com/google/wuffs
comment by snypher · 2021-12-16 · in A deep dive into an NSO zero-click iMessage exploit: Remote Code Execution -
…deleted code is even safer than Rust. Apart from Rust, Wuffs is also a good candidate for codecs: https://github.com/google/wuffs/blob/main/doc/wuffs-the-lang... Too bad that Swift isn't that good for low-level codecs, so a Swift rewrite…
comment by pornel · 2021-12-15 · in A deep dive into an NSO zero-click iMessage exploit: Remote Code Execution -
If you must Wrangle Untrusted File Formats you should do so Safely: https://github.com/google/wuffs
comment by tialaramex · 2021-11-04 · in Gitlab servers are being exploited in DDoS attacks -
I thought this post was one long gag until I found WUFFS on GitHub: https://github.com/google/wuffs
comment by jdblair · 2021-08-29 · in Hell Is Other REPLs -
For a codec, WUFFS might be a better fit than Rust. https://github.com/google/wuffs In Rust, if I have two u8 variables and I add them together, Rust will try to figure out if it's sure at compile time that this is an overflow and if so…
comment by tialaramex · 2021-07-16 · in Is Rust Used Safely by Software Developers? -
I don't agree. Consider WUFFS https://github.com/google/wuffs WUFFS will give you a C library that can turn PNG data into raw image data and is definitely correct. It's not exactly idiomatic C, you'd assume if a person wrote this code it's…
comment by tialaramex · 2021-06-27 · in CompCert – Formally-verified C compiler -
…It's a Google project, and I wouldn't be surprised if it eventually makes its way into Chrome. https://github.com/google/wuffs
comment by vinkelhake · 2021-06-13 · in A few thoughts on Fuchsia security -
…finds out the hard way. Now, on one hand you've got a simple image viewer built with WUFFS: https://github.com/google/wuffs which you are completely sure is safe for viewing the images, you could perhaps glance at a hundred images per…
comment by tialaramex · 2021-06-07 · in Gene sequencer malware injection via encoded DNA (2017) -
…you certainly can't be sure of that, none of the tools you use have such a cautious approach. † https://github.com/google/wuffs
comment by tialaramex · 2021-05-14 · in Using Rust Macros to exfiltrate secrets -
…aspect for a reliable language, it wasn't immediately clear from the docs. Edit ah found it, https://github.com/google/wuffs/blob/main/doc/note/statuses....
comment by mkj · 2021-04-09 · in Wuffs the Language -
…JSON is a pretty simple spec and this obscures it (although to be fair it's also handling UTF-8). https://github.com/google/wuffs/blob/main/std/json/decode_js... Yes it prevents buffer overflows and integer overflow, but it can't prevent…
comment by chubot · 2021-04-08 · in Wuffs the Language -
> I'm curious if it is at all competitive with the Wuffs decoder You could try adapting https://github.com/google/wuffs/tree/main/script/bench-rust-... > https://github.com/bschwind/png-decoder Note that statements like: let…
comment by nigeltao · 2021-04-08 · in Wuffs’ PNG image decoder -
…portability and safe languages. (There may be some contorted way to have Rust emit C, too.) [0]: https://github.com/google/wuffs
comment by loeg · 2021-04-07 · in BleedingTooth: Linux Bluetooth Zero-Click Remote Code Execution -
…[1] is rarely used in C projects to parse untrusted data given that it can be translated to C. [1] https://github.com/google/wuffs
comment by citrin_ru · 2021-04-07 · in BleedingTooth: Linux Bluetooth Zero-Click Remote Code Execution -
The README on GitHub looks useful: https://github.com/google/wuffs
comment by chmaynard · 2021-04-07 · in Wuffs’ PNG image decoder -
…like there isn't an encoder for PNG There isn't one yet, but I'd like to have one at some point. https://github.com/google/wuffs/blob/main/doc/roadmap.md
comment by nigeltao · 2021-04-07 · in Wuffs’ PNG image decoder -
…that. I'm not sure exactly what you're asking for, but see the Coroutines, Effects and I/O pages in https://github.com/google/wuffs/tree/main/doc/note
comment by nigeltao · 2021-04-07 · in Wuffs’ PNG image decoder -
Wuffs does not use a SMT solver. https://github.com/google/wuffs/blob/main/doc/note/assertion... explains.
comment by sanxiyn · 2021-04-07 · in Wuffs’ PNG image decoder -
…(like Rust) or add reference counting (like Rust `Arc`, C++ `shared_ptr`, Golang, Java, etc). [0] https://github.com/google/wuffs/blob/v0.3.0-beta.1/doc/note/...
comment by mleonhard · 2021-04-06 · in Wuffs’ PNG image decoder -
Looks like there isn't an encoder for PNG: https://github.com/google/wuffs/tree/main/std/png Given the project goals, I guess most encoders don't make a lot of sense: For image encoding you basically provide an "x * y * bytes_per_pixel"…
comment by dividuum · 2021-04-06 · in Wuffs’ PNG image decoder -
…First time I've head of Wuffs. As someone that still uses C, this in particular sounds neat: (from https://github.com/google/wuffs#goals-and-non-goals ) """ Wuffs' goal is to produce software libraries that are as safe as Go or Rust,…
comment by dividuum · 2021-04-06 · in Wuffs’ PNG image decoder -
Wuffs? Never heard of that one before. Edit: here's the link, interesting idea. https://github.com/google/wuffs
comment by nerdponx · 2021-02-18 · in Mitigating Memory Safety Issues in Open Source Software -
…also built some languages themselves that solve some of the same problems that Rust solves: https://github.com/google/wuffs
comment by est31 · 2020-11-24 · in Why AWS loves Rust, and how we’d like to help -
But if this is the reason, does it make sense to leave it in then? I.e. to unroll this here: https://github.com/google/wuffs/commit/6537a817b7f8351cded87... I guess, maybe once another global constant is introduced somewhere else, this…
comment by albertzeyer · 2020-06-25 · in C performance mystery: delete unused string constant -
Start at https://github.com/google/wuffs/tree/master/doc
comment by nigeltao · 2020-06-25 · in C performance mystery: delete unused string constant -
…remove a "foo" that was actually in use, so the combination was rolled back. The previous commit is https://github.com/google/wuffs/commit/844fc9b5eeef46edab49c...
comment by nigeltao · 2020-06-25 · in C performance mystery: delete unused string constant -
…project: https://news.ycombinator.com/item?id=15711767 Edit: Looks like it was renamed to Wuffs: https://github.com/google/wuffs It's a domain-specific language for parsers that should be fast and must be correct, and it includes…
comment by tom_mellior · 2017-12-23 · in Ask HN: What were the most important new programming languages released in 2017? -
…for the "We're google, we can pick any name we want" assumption that somebody else wrote earlier, https://github.com/google/puffs says "Disclaimer: This is not an official Google product, it is just code that happens to be owned by…
comment by nigeltao · 2017-11-18 · in Puffs: Parsing Untrusted File Formats Safely -
I'm not entirely sure what you had in mind, but you can express certain inequalities. For example, https://github.com/google/puffs/blob/master/std/gif/decode_l... has this line: assert n_bits < (width + 8) via etc The 'via' syntax is…
comment by nigeltao · 2017-11-17 · in Puffs: Parsing Untrusted File Formats Safely -
…not the only way. Puffs is an imperative language, not functional (for the reasons described in https://github.com/google/puffs/blob/master/doc/related-work... ). With mutable state, a Puffs variable's within-bounds-ness can change over…
comment by nigeltao · 2017-11-16 · in Puffs: Parsing Untrusted File Formats Safely