frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Size of Life

https://neal.fun/size-of-life/
382•eatonphil•2h ago•76 comments

DeepSeek uses banned Nvidia chips for AI model, report says

https://finance.yahoo.com/news/china-deepseek-uses-banned-nvidia-131207746.html
120•goodway•1h ago•83 comments

Is it a bubble?

https://www.oaktreecapital.com/insights/memo/is-it-a-bubble
22•saigrandhi•48m ago•1 comments

Australia begins enforcing world-first teen social media ban

https://www.reuters.com/legal/litigation/australia-social-media-ban-takes-effect-world-first-2025...
73•chirau•1d ago•157 comments

Qwen3-Omni-Flash-2025-12-01:a next-generation native multimodal large model

https://qwen.ai/blog?id=qwen3-omni-flash-20251201
74•pretext•2h ago•33 comments

Auto-grading decade-old Hacker News discussions with hindsight

https://karpathy.bearblog.dev/auto-grade-hn/
16•__rito__•55m ago•5 comments

Why the Sanitizer API is just `setHTML()`

https://frederikbraun.de/why-sethtml.html
40•birdculture•1d ago•16 comments

Factor 0.101 now available

https://re.factorcode.org/2025/12/factor-0-101-now-available.html
37•birdculture•6h ago•3 comments

9 Mothers (YC X26) Is Hiring

https://app.dover.com/jobs/9mothers
1•ukd1•1h ago

Launch HN: InspectMind (YC W24) – AI agent for reviewing construction drawings

18•aakashprasad91•2h ago•8 comments

COM Like a Bomb: Rust Outlook Add-in

https://tritium.legal/blog/outlook
39•piker•3h ago•14 comments

Qualcomm acquires RISC-V focused Ventana Micro Systems

https://www.qualcomm.com/news/releases/2025/12/qualcomm-acquires-ventana-micro-systems--deepening...
31•fork-bomber•2h ago•33 comments

Valve: HDMI Forum Continues to Block HDMI 2.1 for Linux

https://www.heise.de/en/news/Valve-HDMI-Forum-Continues-to-Block-HDMI-2-1-for-Linux-11107440.html
62•OsrsNeedsf2P•58m ago•17 comments

Golang's big miss on memory arenas

https://avittig.medium.com/golangs-big-miss-on-memory-arenas-f1375524cc90
37•andr3wV•6d ago•22 comments

Gundam is just the same as Jane Austen but happens to include giant mech suits

https://eli.li/gundam-is-just-the-same-as-jane-austen-but-happens-to-include-giant-mech-suits
6•surprisetalk•1w ago•0 comments

Volcanic eruptions set off a chain of events that brought Black Death to Europe

https://www.cam.ac.uk/stories/volcanoes-black-death
43•gmays•4d ago•4 comments

Typewriter Plotters (2022)

https://biosrhythm.com/?p=2143
25•LaSombra•5d ago•0 comments

Super-Flat ASTs

https://jhwlr.io/super-flat-ast/
25•mmphosis•6d ago•1 comments

RoboCrop: Teaching robots how to pick tomatoes

https://phys.org/news/2025-12-robocrop-robots-tomatoes.html
17•smurda•2h ago•7 comments

Revisiting "Let's Build a Compiler"

https://eli.thegreenplace.net/2025/revisiting-lets-build-a-compiler/
208•cui•11h ago•35 comments

Deprecations via warnings don't work for Python libraries

https://sethmlarson.dev/deprecations-via-warnings-dont-work-for-python-libraries
18•scolby33•2d ago•20 comments

England Historic Aerial Photo Explorer

https://historicengland.org.uk/images-books/archive/collections/aerial-photos/
17•davemateer•2h ago•3 comments

Map of all the buildings in the world

https://gizmodo.com/literally-a-map-showing-all-the-buildings-in-the-world-2000694696
137•dr_dshiv•5d ago•47 comments

PeerTube is recognized as a digital public good by Digital Public Goods Alliance

https://www.digitalpublicgoods.net/r/peertube
649•fsflover•1d ago•140 comments

Israel used Palantir technologies in pager attack in Lebanon

https://the307.substack.com/p/revealed-israel-used-palantir-technologies
110•cramsession•3h ago•49 comments

Rust in the kernel is no longer experimental

https://lwn.net/Articles/1049831/
863•rascul•15h ago•635 comments

In New York City, congestion pricing leads to marked drop in pollution

https://e360.yale.edu/digest/new-york-congestion-pricing-pollution
336•Brajeshwar•2h ago•328 comments

Cloth Simulation

https://cloth.mikail-khan.com/
155•adamch•1w ago•31 comments

New benchmark shows top LLMs struggle in real mental health care

https://swordhealth.com/newsroom/sword-introduces-mindeval
84•RicardoRei•4h ago•115 comments

Show HN: Gemini Pro 3 imagines the HN front page 10 years from now

https://dosaygo-studio.github.io/hn-front-page-2035/news
3217•keepamovin•1d ago•916 comments
Open in hackernews

Why the Sanitizer API is just `setHTML()`

https://frederikbraun.de/why-sethtml.html
40•birdculture•1d ago

Comments

brainbag•1h ago
With context, this article is more interesting than the title might imply.

> The Sanitizer API is a proposed new browser API to bring a safe and easy-to-use capability to sanitize HTML into the web platform [and] is currently being incubated in the Sanitizer API WICG, with the goal of bringing this to the WHATWG.

Which would replace the need for sanitizing user-entered content with libraries like DOMPurify by having it built into the browser's API.

The proposed specification has additional information: https://github.com/WICG/sanitizer-api/

mubou2•46m ago
The author really needs to start with that. They say "the API that we are building" and assume I know who they are and what they're working on, all the way until the very bottom. I just assumed it's some open source library.

> HTML parsing is not stable and a line of HTML being parsed and serialized and parsed again may turn into something rather different

Are there any examples where the first approach (sanitize to string and set inner html) is actually dangerous? Because it's pretty much the only thing you can do when sanitizing server-side, which we do a lot.

Edit: I also wonder how one would add for example rel="nofollow noreferrer" to links using this. Some sanitizers have a "post process node" visitor function for this purpose (it already has to traverse the dom tree anyway).

tobr•35m ago
> They say "the API that we are building" and assume I know who they are and what they're working on, all the way until the very bottom.

This is a common and rather tiresome critique of all kinds of blog posts. I think it is fair to assume the reader has a bit of contextual awareness when you publish on your personal blog. Yes, you were linked to it from a place without that context, but it’s readily available on the page, not a secret.

mubou2•25m ago
Well that's... certainly a take. But I have to disagree. Most traffic coming to blog posts is not from people who know you and are personally following your posts, they're from people who clicked a link to the article someone shared or found it while googling something.

It's not hard to add one line of context so readers aren't lost. Here, take this for example, combining a couple parts of the GitHub readme:

> For those who are unfamiliar, the Sanitizer API is a proposed new browser API being incubated in the Sanitizer API WICG, with the goal of bringing this to the WHATWG.

Easy. Can fit that in right after "this blog post will explain why", and now everyone is on the same page.

swiftcoder•16m ago
> Most traffic coming to blog posts is not from people who know you and are personally following your posts

Do we have data to back that up? Anecdotally the blogs I have operated over the years tend to mostly sustain on repeat traffic from followers (with occasional bursts of external traffic if something trends on social media)

LegionMammal978•29m ago
They had a link in their post [0]: it seems like most of the examples are with HTML elements with wacky contextual parsing semantics such as <svg> or <noscript>. Their recommendation for server-side sanitization is "don't, lol", and they don't offer much advice regarding it.

Personally, my recommendation in most cases would be "maintain a strict list of common elements/attributes to allow in the serialized form, and don't put anything weird in that list: if a serialize-parse roundtrip has the remote possibility of breaking something, then you're allowing too much". Also, "if you want to mutate something, then do it in the object tree, not in the serialized version".

[0] https://www.sonarsource.com/blog/mxss-the-vulnerability-hidi...

mubou2•20m ago
Ah, I see what they're talking about. That's a good article; my brain totally skipped over that link. Thanks.
crote•23m ago
> Are there any examples where the first approach (sanitize to string and set inner html) is actually dangerous?

The article links to [0], which has some examples of instances in which HTML parsing is context-sensitive. The exact same string being put into a <div> might be totally fine, while putting it inside a <style> results in XSS.

[0]: https://www.sonarsource.com/blog/mxss-the-vulnerability-hidi...

crote•36m ago
Yeah, I was expecting something closer to "because that's what people Google for".

A big part of designing a security-related API is making it really easy and obvious to do the secure thing, and hide the insecure stuff behind a giant "here be dragons" sign. You want people to accidentally do the right thing, so you call your secure and insecure functions "setHTML" and "setUnsafeHTML" instead of "setSanitizedHTML" and "setHTML".

cobbal•52m ago
Makes sense. I think this is a variant of the "parse, don't validate" motto, but is more "parse, don't parse-serialize-parse" in the implementation.
nayuki•39m ago
> HTML parsing is not stable and a line of HTML being parsed and serialized and parsed again may turn into something rather different

This is why people should really use XHTML, the strict XML dialect of HTML, in order to avoid these nasty parsing surprises. It has the predictable behavior that you want.

In XHTML, the code does exactly what it says it does. If you write <table><a></a></table> like the example on the mXSS page, then you get a table element and an anchor child. As another example, if you write <table><td>xyz</td></table>, that's exactly what you get, and there are no implicit <tbody> or <tr> inserted inside.

It's just wild as I continue to watch the world double down for decades on HTML and all its wild behavior in parsing. Furthermore, HTML's syntax is a unique snowflake, whereas XML is a standardized language that just so happens to be used in SVG, MathML, Atom, and other standards - no need to relearn syntax every single time.

bayesnet•9m ago
I don’t think this is right. XHTML guarantees well-formedness (matched closing tags et al) but doesn’t do anything for validity. It’s not semantically valid for <td> to be a direct child of <table>, so the user agent has to make the call as to what to display regardless of the (X)HTML flavor. The alternative is parsing failure on improperly nested HTML which I don’t think is desirable.
philipwhiuk•39m ago
The downside of a new method is that it leaves innerHtml as a source of future security issues.
cluckindan•32m ago
Yes, one could simply make a setter for innerHTML which calls setHTML(). No code changes needed.
crote•30m ago
Yes, but you can also easily lint on it: all uses of `context.innerHTML` are now suspect and should get a suggestion to use `context.setHTML` instead.

With `const clean = DOMPurify.sanitize(input); context.innerHTML = clean;` your linter suddenly needs to do complex code analysis and keep track if each variable passed to `context.innerHTML` is clean or tainted.

wbobeirne•26m ago
I feel like calling this a downside implies there's an alternative, but there's no way that `innerHtml`'s behavior could be changed. There are a lot of valid reasons for arbitrary HTML to be set, and changing that would break so many things.