Hacker GitHub

← All repos

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

Mentions per year 121 mentions · busiest year 2021 (28)
20082026
  1. …compiler to prove the addition wouldn’t overflow. Wuffs is specialized enough to do exactly that ( https://github.com/google/wuffs ).
  2. 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?
  3. …Wuffs, a language focused on writing safe file format handlers (parsing, encoding, decoding) https://github.com/google/wuffs
  4. …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
  5. 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
  6. 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
  7. > 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…
  8. [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
  9. …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
  10. 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
  11. …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
  12. …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
  13. …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?
  14. For anyone curious: https://github.com/google/wuffs
    comment by eru · 2022-06-13 · in Data Race Patterns in Go
  15. 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
  16. Indeed, you should be Wrangling Untrusted File Formats Safely https://github.com/google/wuffs
  17. 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…
  18. …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…
  19. …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…
  20. …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
  21. https://github.com/google/wuffs
  22. …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…
  23. If you must Wrangle Untrusted File Formats you should do so Safely: https://github.com/google/wuffs
  24. 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
  25. 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?
  26. 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
  27. …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
  28. …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…
  29. …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
  30. …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
  31. …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
  32. > 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
  33. …portability and safe languages. (There may be some contorted way to have Rust emit C, too.) [0]: https://github.com/google/wuffs
  34. …[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
  35. The README on GitHub looks useful: https://github.com/google/wuffs
    comment by chmaynard · 2021-04-07 · in Wuffs’ PNG image decoder
  36. …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
  37. …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
  38. 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
  39. …(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
  40. 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
  41. …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
  42. Wuffs? Never heard of that one before. Edit: here's the link, interesting idea. https://github.com/google/wuffs
  43. …also built some languages themselves that solve some of the same problems that Rust solves: https://github.com/google/wuffs
  44. 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…
  45. Start at https://github.com/google/wuffs/tree/master/doc
  46. …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...
  47. …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…
  48. …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…
  49. 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…
  50. …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…