Simon Willison’s Weblog

Subscribe

December 2021

52 posts: 5 entries, 15 links, 2 quotes, 30 beats

Dec. 16, 2021

A deep dive into an NSO zero-click iMessage exploit: Remote Code Execution (via) Fascinating and terrifying description of an extremely sophisticated attack against iMessage. iMessage was passing incoming image bytes through to a bunch of different libraries to figure out which image format should be decoded, including a PDF renderer that supported the old JBIG2 compression format. JBIG2 includes a mechanism for programatically swapping the values of individual black and white pixels... which turns out to be Turing complete, and means that a sufficiently cunning “image” can include a full computer architecture defined in terms of logical bit operations. Combine this with an integer overflow and you can perform arbitrary memory operations that break out of the iOS sandbox.

# 8:33 pm / security

Weeknotes: Trapped in an eternal refactor

Visit Weeknotes: Trapped in an eternal refactor

I’m still working on refactoring Datasette’s table view. In doing so I spun out a new plugin, datasette-pretty-traces, which improves Datasette’s tooling for seeing the SQL that was executed to build a specific page.

[... 544 words]

TIL Registering the same Pluggy hook multiple times in a single file — I found myself wanting to register more than one instance of a [Pluggy](https://pluggy.readthedocs.io/) plugin hook inside a single module.

Dec. 17, 2021

Release datasette 0.60a0 — An open source multi-tool for exploring and publishing data

TypeScript for Pythonistas (via) Really useful explanation of how TypeScript differs from Python with mypy. I hadn’t realized TypeScript leans so far into structural typing, to the point that two types with different names but the same “shape” are identified as being the same type as each other.

# 7:43 pm / python, typescript, mypy

TIL Creating a minimal SpatiaLite database with Python — When writing a test for [datasette-leaflet-freedraw](https://github.com/simonw/datasette-leaflet-freedraw) I realized I didn't have a simple tiny recipe for creating an in-memory SpatiaLite database in Python. I came up with this:

Dec. 18, 2021

TIL Safely outputting JSON — Carelessly including the output of `json.dumps()` in an HTML page can lead to an XSS hole, thanks to the following:

Transactionally Staged Job Drains in Postgres. Any time I see people argue that relational databases shouldn’t be used to implement job queues I think of this post by Brandur from 2017. If you write to a queue before committing a transaction you run the risk of a queue consumer trying to read from the database before the new row becomes visible. If you write to the queue after the transaction there’s a risk an error might result in your message never being written. So: write to a relational staging table as part of the transaction, then have a separate process read from that table and write to the queue.

# 1:34 am / postgresql, queues, scaling, brandur-leach

Dec. 19, 2021

Release datasette-pretty-traces 0.3 — Prettier formatting for ?_trace=1 traces
Release datasette-pretty-traces 0.3.1 — Prettier formatting for ?_trace=1 traces
Release datasette 0.60a1 — An open source multi-tool for exploring and publishing data

Dec. 20, 2021

TIL Annotated explanation of David Beazley's dataklasses — David Beazley [on Twitter](https://twitter.com/dabeaz/status/1472742536649351173):

Annotated explanation of David Beazley’s dataklasses (via) David Beazley released a self-described “deliciously evil spin on dataclasses” that uses some deep Python trickery to implement a dataclass style decorator which creates classes that import 15-20 times faster than the original. I put together a heavily annotated version of his code while trying to figure out how all of the different Python tricks in it work.

# 5:05 am / david-beazley, python, til

Dec. 21, 2021

Release asyncinject 0.2 — Run async workflows using pytest-fixtures-style dependency injection
TIL Adding a robots.txt using Cloudflare workers — I got an unexpected traffic spike to https://russian-ira-facebook-ads.datasettes.com/ - which runs on Cloud Run - and decided to use `robots.txt` to block crawlers.

Dec. 23, 2021

Release datasette-tiddlywiki 0.1 — Run TiddlyWiki in Datasette and save Tiddlers to a SQLite database
TIL Transferring a GitHub issue from a private to a public repository — I have my own private `notes` repository where I sometimes create research threads. Occasionally I want to transfer these to a public repository to publish their contents.

Dec. 24, 2021

Weeknotes: datasette-tiddlywiki, filters_from_request

Visit Weeknotes: datasette-tiddlywiki, filters_from_request

I made some good progress on the big refactor this week, including extracting some core logic out into a new Datasette plugin hook. I also got distracted by TiddlyWiki and released a new Datasette plugin that lets you run TiddlyWiki inside Datasette.

[... 1,197 words]

The Asymmetry of Open Source (via) Caddy creator Matt Holt provides “a comprehensive guide to funding open source software projects”. This is really useful—it describes a whole range of funding models that have been demonstrated to work, including sponsorship, consulting, private support channels and more.

# 9:11 pm / open-source, matt-holt

Many of you here today are toolbuilders who help people work with data. Rather than presuming that those using your tools are clear-eyed about their data, how can you build features and methods that ensure people know the limits of their data and work with them responsibly? Your tools are not neutral. Neither is the data that your tools help analyze. How can you build tools that invite responsible data use and make visible when data is being manipulated? How can you help build tools for responsible governance?

danah boyd

# 11:41 pm / ethics, data-science

Dec. 29, 2021

TIL kubectl proxy — Learned about this today as a way of accessing the Kubernetes REST API.
TIL WebAuthn browser support — I [started exploring](https://twitter.com/simonw/status/1476249939516616704) **[WebAuthn](https://webauthn.guide/)** today - a set of browser standards that adds support for both Yubikey 2FA hardware devices and "platform" authentication using things like Touch ID and Face ID.

2021 » December

MTWTFSS
  12345
6789101112
13141516171819
20212223242526
2728293031