HNHacker News
TopNewBestAskShowJobs

_urga

1 karma · joined December 26, 2025

submissionscomments
_urga··on DOMPurify, Security in the DOM, and Why We Really Need Both [pdf]
I don't see any evidence of alleged DOM-bashing in Mario's slides?

In fact, rather than bash the DOM, Mario wants the DOM to subsume his own DOMPurify project, rather than have users trust him as a third-party module developer. I think that paints the DOM in a favorable light if you ask me.

_urga··on DOMPurify, Security in the DOM, and Why We Really Need Both [pdf]
You can do that with DOMPurify using hooks.
_urga··on DOMPurify, Security in the DOM, and Why We Really Need Both [pdf]
"even if somehow server-side algorithms are better (which this presentation seems to imply)"

The slides provide several reasons why server-side algorithms are worse.

"the situation is better client-side, because when running code on the client's side, you can check how exactly the browser parses the HTML code."

Yes, and for this reason, DOMPurify is a client-side sanitizer.

_urga··on DOMPurify, Security in the DOM, and Why We Really Need Both [pdf]
"If you have end-to-end encryption you can't sanitize in the client."

I think you meant to type that you can't sanitize in the "server"? Because with end-to-end encryption the server has no access to the plaintext to be sanitized. Only the client can sanitize, only the client has the plaintext.

_urga··on DOMPurify, Security in the DOM, and Why We Really Need Both [pdf]
DOMPurify (as a client-side sanitizer) uses a whitelist. There's also CSP for defense-in-depth.

I would be more concerned of using server-side sanitizers due to the impedance mismatch between client/server HTML parsing algorithms.

_urga··on Can I Email: ‘Can I Use’ for email
How about this?

  Hello
  ...
  ...
  Thanks!
_urga··on The design of littlefs: A fail-safe filesystem designed for microcontrollers
> Logging filesystem are beautifully elegant. With a checksum, we can easily detect power-loss and fall back to the previous state by ignoring failed appends.

An edge case when designing a log-structured file system is that a corrupt checksum in a log entry could actually mean one of three things: power loss while writing the last transaction, a misdirected write or bitrot, or a misdirected read.

If you simply read the log up until the corrupt checksum, assuming this can only mean one thing, then you might fall too far back and lose data that has been acknowledged to the user as synced. This could in turn then break the guarantees required for implementing things like Paxos, which could ultimately wreak havoc with a distributed system.

To detect power-loss, you need more than just a checksum. You need a checksum, but you also need a way to "snap" the new log tail onto the old log tail in a two-phase commit. So you write out all your data, then you write out your new log tail, then you sync, then you snap your new log tail on using two atomic sector writes, one of which needs to be synced.

The number of syncs are the same as before, you haven't actually added any additional syncs, but this way you ensure that your log references data which exists, and you can now tell the difference between a power failure and a corrupt log entry.

A power failure is recoverable (roll back), but a corrupt log entry is unrecoverable (assuming no log entry replicas) and means the file system is unmountable.

_urga··on Introducing nushell
Sure, and 5 would be:

Prefer dependencies with smaller flatter dependency trees.

_urga··on Introducing nushell
> How is this an easy fix? Now developers need to develop and maintain O(N) instead of O(1) software projects.

At some point, developers need to take responsibility for the security of their projects. If your project is larger, you will need to maintain more code, whether directly or indirectly. You can't simply import a dependency but never audit it. And if you're taking the trouble to audit a third-party dependency, at some point it becomes worth maintaining directly.

> sensitive dependencies, like crypto or network / http libraries.

I am not suggesting that developers reimplement TCP.

_urga··on Introducing nushell
The risk of a supply chain attack, roughly speaking, is then multiplied by all 73 dependencies. If any of those are compromised, the shell and system are compromised.

To ameliorate the risk, the security of all 73 dependencies would need to be at least an order of magnitude greater, just to catch up to shells with no dependencies.

The irony is that this lack of "dependency-safety" is far more easily exploitable than any previous lack of "memory-safety".

Of course, this can be easily fixed if developers stop multiplying third-party dependencies, so that importing a dependency involves O(1) risk, not O(?).

_urga··on Levenshtein Distance
Here's a helpful tip in case it comes in handy one day:

If you need to run Levenshtein Distance over tens of thousands of strings, perhaps as part of a fuzzy search, and you only need to match on distances of 0 or 1, not any distance in general, then there's an optimization on Levenshtein Distance where you hard code the function just for distances of 0 or 1. It's not difficult to do and the payoff might enable new applications of what would otherwise be too costly.

_urga··on Making email more modern with JMAP
> Not full history as in "you can rewind back in time and see every possible past state", no. If I wanted one of those, I'd probably use git as the substrate.

No, not "history" in the git sense, just "history" in the simpler email sense, i.e. "email history", all past emails in their final converged state.

_urga··on Making email more modern with JMAP
> but at the point where you're switching between multiple masters in a split brain from your client, all bets are off

CRDTs handle split brain fine. They eventually converge. You just don't want your clients flapping in the meantime by resyncing tons of data. That's where a distributed sync algorithm would help keep things working in the interim.

_urga··on Making email more modern with JMAP
> Merkle tree would is great for full history - [...] but it's way over-expensive for email.

Does JMAP then not support syncing full history efficiently as a key design priority?

> That would be a pretty massive change to the entire data model of IMAP. It's never going to happen[tm].

Sure, and that's why I had hoped JMAP would, especially in a distributed master setting, since this was something IMAP overlooked.

I guess it's because JMAP still needs to be backwards-compatible with the strict consistency master-slave restriction of IMAP?

> What we use for IMAP replication in Cyrus is much dumber than all this - it uses a per-message CRC and XORs them together for the whole mailbox to create the sync_crc value. If those don't match, it does a resync. Fixes up split brain just fine while being cheap and dumb for the common case.

You're implementing the first layer of an incremental Merkle tree right there. How many bits are those CRCs just out of interest?

_urga··on Making email more modern with JMAP
> I wrote something about how you fix UID clashes in a split brain while staying within the IMAP data model many years ago...

Thanks for this. It was a good read and promoting UIDs instead of bumping UIDVALIDITY is a great idea.

Surely, it would be even better if IMAP had support for distributed Merkle Tree synchronization, so that clients can sync with different server replicas without the server replicas having to coordinate or promote UIDs at all in the first place?

I don't know of any algorithm other than a Merkle Tree that will do this correctly and simply and efficiently in a distributed setting?

_urga··on Making email more modern with JMAP
> /changes lists all the IDs that might have changed.

How does it do this in a distributed setting? When clients might be connecting to multiple servers with different states?

_urga··on Making email more modern with JMAP
> IMAP is costly to implement in terms of server resources when you're doing true concurrency, high availability

Yes, IMAP requires expensive coordination among multi-master servers to generate UIDs in such a way that won't mess with client synchronization. In other words, IMAP is not a fully distributed design, it assumes a centralized control plane (think Raft or Paxos), i.e. a single central server with many distributed clients, which is a shame for new systems building on CRDTs.

How does JMAP address this achilles heel of IMAP? Merkle tree sync?

More detail on the problem: https://news.ycombinator.com/item?id=20479011

_urga··on A better zip bomb [WOOT '19 Paper] [pdf]
That's fantastic news. Well deserved. It was a brilliant paper: none of the typical reliance on recursion, compatibility with most decoders, and super massive expansion factor.

Do you know if anyone who was there managed to record the talk? I asked Usenix already but they weren't recording.

_urga··on What Is Zig's Comptime?
Sure, but then not even "safe" languages like JavaScript will prevent all memory bugs.

And to be fair, Rust does introduce memory issues of its own in terms of allocation strategy. For certain projects, Rust would not be considered "safe" with respect to memory.

Zig's release-safe mode is worlds away from "the memory bugs that exist in C".

See also: https://github.com/ziglang/zig/issues/2301

_urga··on What Is Zig's Comptime?
> the memory bugs that exist in C also exist in Zig.

No, they don't. See Zig's release-safe mode.

Also: https://news.ycombinator.com/item?id=17184929

> the trade-off that the Rust offers is more in line with my values and my ethics.

By the way, it's awesome that you like Rust, but there's no need to imply there's something ethically wrong with Zig. Depending on the platform you're targeting, you may yet find a use for either language.

_urga··on What Is Zig's Comptime?
Zig is worth supporting. Andrew Kelley, the author, was recently accepted into GitHub's Sponsors program. This means for every $1 you contribute, GitHub will match your donation for the first year:

https://github.com/users/andrewrk/sponsorship

_urga··on The Fully Remote Attack Surface of the iPhone
> some email providers also filter incoming messages and remove malformed MIME components that are needed to reach a vulnerability.

I wrote @ronomon/mime [1] for this purpose, to protect downstream user email clients from MIME bombs [2], invalid charsets which can crash Apple Mail, multiple From headers which can exploit Gmail [3], attachment directory traversals, malicious continuation indices, truncated MIME messages, stack overflows etc.

[1] https://github.com/ronomon/mime

[2] https://snyk.io/blog/how-to-crash-an-email-server-with-a-sin...

[3] https://blog.cotten.io/ghost-emails-hacking-gmails-ux-to-hid...

_urga··on Ubuntu ZFS support in 19.10: introduction
The linked article is a good example of where choosing a cipher such as ChaCha20-Poly1305 can be a fraction slower than AES but also more reliable and forward-compatible when CPU extensions are suddenly switched off. Imagine the not-too-distant future where a Spectre-like bug forces kernels to disable certain CPU extensions, and you suddenly find yourself stuck with mountains of data encrypted with the wrong cipher that only works safely and tolerably when hardware-accelerated.
_urga··on The Linux kernel's inability to gracefully handle low memory pressure
Sure, for modern systems "transfer rates of 30 seconds per byte" would also be "a huge signal flare going off instantly" where metrics track basic software-hardware interaction (latency and throughput, not just on/off error rates).

These metrics also need not necessarily by definition take longer to notice gray failures. You can detect a gray failure transfer rate without having to wait 30 seconds. Another example, but a second or two is enough to notice disk latency issues (and retry to a faster disk), which is probably in the same granularity as the window for detecting "Connection refused".

_urga··on What’s New in ES2019
Most of this is sugar, e.g. flat() and flatMap(), out of scope for a language spec.

Function.toString being more accurate is helpful.

But real progress would be removing dangerous backtracking regular expressions in favor of RE2: https://github.com/google/re2/wiki/Syntax

_urga··on How we send 22k emails every hour
I think you would be surprised at how many outsourced solutions don't deal with all the RBL issues, complaints, RFC compliance etc.
_urga··on How we send 22k emails every hour
Nothing other than stock settings and the latest signatures, same as VirusTotal's ClamAV I think?
_urga··on How we send 22k emails every hour
"before that the inbound email is scanned for viruses (ClamAV)"

We moved away from ClamAV because it detected less than a tenth of virus samples we tested in practice. Simple things like EXEs, ISOs, VBAs and JS attachments.

VirusTotal uploads showed the same single digit detection rate for ClamAV.

I thought ClamAV was a better scanner, have things stagnated?

_urga··on Use plaintext email
MIME is hard enough:

https://snyk.io/blog/how-to-crash-an-email-server-with-a-sin...

_urga··on Use plaintext email
The RFC you quoted actually refers to line lengths within a MIME message as a whole (headers and body), and only after Content-Transfer-Encoding has been applied, not before.

In other words, your text parts can have lines of arbitrary line length, provided you encode them as QuotedPrintable or Base64 and set the Content-Transfer-Encoding header accordingly, which most email clients do.

← PreviousPage 4 of 28Next →