Better HN
topnewbestaskshowjobs
Log inSign up

woodruffw

42,655 karma · joined May 26, 2015 (11y ago) · 8,216 submissions

I'm a Software Engineer in New York City. Before that, I studied philosophy.

On the philosophy side, I'm chiefly interested in metaphysics (ontology and mathematics/formal systems & semantics) and deontological ethics (praise and blame, moral education, honesty & bad faith).

On the computational side, I'm chiefly interested in program analysis (compilers), security (compilers), and systems (compilers). I do a decent amount of professional open source work on projects that encompass some of those.

My opinions are my own and do not reflect those of any employer, institutions, affiliates, lovers or haters past, present, or future. They might not even be mine anymore!

Sites: https://yossarian.net / https://blog.yossarian.net / @yossarian@infosec.exchange

Submissions

comment 1d ago · link · parent

It's worth noting that C and C++ have already diverged significantly. The two have different undefined behavior, different aliasing and punning semantics, etc.

(The two most famous examples of this are type punning, which is well-defined in C but not in C++, and infinite loops without side effects, which were UB in C++ until this year because of C++'s stricter forward progress guarantee.)

2.

GitHub Actions accepts invalid YAML(yossarian.net ↗)

4 points · by woodruffw · 2d ago · discuss

comment 4d ago · link · parent

It’s a dogwhistle. They’re not talking about Anthropic’s culture.

4.

Stricter checks for uploaded distributions on PyPI(blog.pypi.org ↗)

4 points · by woodruffw · 6d ago · discuss

5.

Large, Empty Deflate Streams(yossarian.net ↗)

2 points · by woodruffw · 6d ago · discuss

comment 1w ago · link · parent

No, I wouldn't say that's right. Attestations are signatures from user-held keys under the hood; they're just short-lived keys bound to an identity rather than long-lived keys.

The nuance is that the party that does that binding is typically someone who is doing more than keeping their private keys on disk, which is why they're trusted to handle more than short-lived key materials. As mentioned elsewhere that can include "big tech companies" (is ActiveState big? I have no idea) but PyPI also supports self-hosted GitLab instances for organizations. Key management is what matters to us, and knowing that we can trust the parties that we still have to trust.

comment 1w ago · link · parent

The Web PKI does not allow self-signed certificates. You can self-sign a certificate and badger your users into trusting it, but as you note the browsers won't help you do that because it's a security pit of despair.

> you won't even allow the equivalent of a self-signed certificate at all.

You can embed a signature into a Python package if you want. There's even a spec for it[1], although nobody has ever really adopted it. And, of course, you can always host a signature somewhere else (and even link to it via standard packaging metadata). But PyPI will no longer allow you to upload a PGP sidecar (which were never standardized, either) because we have strong evidence that (1) nobody ever really bothered to verify them, and (2) even if they had, the quality of the key material was poor.

[1]: https://peps.python.org/pep-0427/#signed-wheel-files

comment 1w ago · link · parent

My employer is a matter of public record, as is the fact that I’ve worked in PyPI for years on both my own time and at other jobs. You’re letting the tail wag the dog.

(Note also that none of the work being talked about right now was paid for by my current employer. I wasn’t even involved in it. I’m only familiar with it circa 2022-24, when I had a different employer.)

comment 1w ago · link · parent

There’s an open issue for it, but nobody is currently working on it. It’s not a mandatory feature or even something that installers current look at; if and when they do I think it’d be a much higher priority subject.

comment 1w ago · link · parent

Given infinite time and engineering talent, PyPI could do a lot of things. The things we actually do reflect the outer envelope of what we can do.

(Python packaging isn’t anywhere close to reproducible, and it isn’t clear how PyPI would enforce that without pissing off >90% of the ecosystem.)

comment 1w ago · link · parent

As can be seen in every sub-thread of this HN post, users are constantly buffeted by bad advice around key management and generation. It’s the reason applied cryptographers still have to even say “don’t use PGP,” despite it not being a sensible thing to even seek out in 2026 (much less 2016).

(Other large-scale PKI initiatives, like the Web PKI, learned this a long time ago. It’s why we have the CABF BRs instead of asking end users to pinky promise that they’re going to securely generate -‘d store a key and keep it around for 10+ years.)

comment 1w ago · link · parent

> Which is great--but does not in any way require that the attestation can only be produced by working through one of a small set of recognized "forges"

That's true, there's some context elsewhere in these threads about how PyPI can enable email attestations. The short version is that PyPI wanted to make this work by default, which was trivial with Trusted Publishing (since it already provides a strong source of verifiable machine identity).

"Why not a public key?" is a good question, and the very short answer is that greenfield signing designs should not assume that all users are able to manage the secrecy of long-lived key materials, much less force them to make parameter decisions when (re)generating materials. This is the same mistake that the Web PKI made for decades, and has spent the last 15 years slowly untangling. The ideal setup is one where users demonstrate control over an identity, and then the signing scheme binds that identity to a short-lived signing key. That's how email attestations work.

comment 1w ago · link · parent

Attestations are code-signing. PyPI once supported PGP signatures on uploads, but as since disabled it because (1) only a tiny minority of users ever signed, and (2) many of the signatures and corresponding keys were either functionally insecure or unusable.

Both of these are latent problems when trying to use PGP in packaging ecosystems; the subset of ecosystems that successfully adopt PGP tend to have very different topologies (namely, small rings of trusted...publishers) rather than an "anyone can publish" architecture like PyPI has.

comment 1w ago · link · parent

I don't think we require a Trusted Publishing provider to use a physical HSM. As I've said in other venues, even a self-hosted Vault instance would almost certainly be fine. But storing private keys on disk is not, and we owe PyPI's users a higher standard of care than saying otherwise.

(I also don't hand out gold stars, and my employer does not direct my work on PyPI.)

comment 1w ago · link · parent

I mean, my actual prior here is that nobody should care or even think about this stuff. Authenticity and minimally-scoped credentials should be ambient properties of a system, not something that users even need to read docs for, much less enable. But if we're engaging with the premise that users are looking at this stuff at all, then I think it's facially reasonable to expect them to read the docs.

For context: attestations aren't something you even really enable. They just happen, by default, if you use Trusted Publishing from a forge like GitHub or GitLab (and hopefully, more in the future).

FWIW, your feedback on the docs is very helpful. It's genuinely useful to hear that the phrasing in it is imprecise, and I'll try and improve some of it this week. The main confusion that I think you're having (which is IMO reasonable) is that the doc was written to be theoretically splittable from the "Trusted Publishing" concept, i.e. so that "publishers" (principals who can publish) who aren't tied to a Trusted Publisher can attest to their published files.

comment 1w ago · link · parent

This is true, and it’s why I’m hopeful that some of the newer forges can make meaningful default posture improvements that make migration away from centralized services the dispassionate choice to a user who cares about availability and security.

comment 1w ago · link · parent

Please see the other comments in this thread (as well as on PyPI's issue tracker) for some important context here. It's not enough to throw JWTs over the wall, PyPI also needs to know that it can trust any given service to operationalize the ugly and risk-prone parts of managing PKI.

(I haven't looked at Tangled at all. If Tangled has a secret management story for its PKI that's stronger than a private key on disk and can demonstrate that a non-trivial number of PyPI users would benefit from federation, then it's a strong candidate.)

comment 1w ago · link · parent

> This shows they're not just, IDK, bowing to Microsoft's demands.

Not only don't we, but I must emphasize that Microsoft did not pay for anything involving the implementation of either Trusted Publishing or attestations on PyPI. I wrote a personal blog post explaining some of my own rationale for why we prioritized GitHub and GitLab for PyPI's initial support targets, and it shouldn't be surprising to anybody who knows me that the reasons are pragmatic, not dogmatic[1].

[1]: https://blog.yossarian.net/2024/11/18/Security-means-securin...

comment 1w ago · link · parent

The current formats (publish and SLSA provenance) are for attesting publishing and build steps, respectively, but there's nothing stopping PyPI from adding a different, new attestation statement for local builds (something that conveys "I did this locally, and I was this principal (email address) when I did it").

comment 1w ago · link · parent

There's a discussion thread for email attestations here[1]. Those would support local builds.

But to take a step back: if you want attested builds because you think attestation is itself a gold star, then you're working from the wrong priors. Attestations do not imply that a package is secure any more than a hash does; what they are is a cryptographic signature over a set of claims, which allows for authenticated auditing of a project's state over time.

I think PyPI's documentation does a good job of conveying this nuance[2], and that much of the opprobrium of attestations comes from people either not understanding that nuance or imputing conspiracies into it.

[1]: https://github.com/pypi/warehouse/issues/18007

[2]: https://docs.pypi.org/attestations/security-model/#trustwort...

comment 1w ago · link · parent

Homebrew actually has full provenance. We added it in 2024 (I think, that’s from memory). We never flipped the default verification policy because of some integration concerns, but my understanding is that various downstreams and MDMs do consume and verify Homebrew’s attestations.

Edit: I should qualify: Homebrew’s own processes verify its attestations. But that’s not enabled by default on end user machines because it slows installations down and currently requires the `gh` CLI. Neither of those is a tenable long term constraint for a default feature.

comment 1w ago · link · parent

> Having some non-profit entities here would be extremely helpful.

I fully agree. I am hopeful that Forgejo or whatever other underlying component of Codeberg can improve its key management primitives here, which would make it very easy to argue for their inclusion as a federated party.

comment 1w ago · link · parent

> The design itself should be able to scale for individual OIDC providers through webfinger and OIDC discovery like Tailscale does it[1], but it doesn't look like it's there yet.

This is the right idea, but it's actually not that simple unfortunately: Trusted Publishing relies on per-IdP claims that are more precise than the `sub` claim (because doing pattern matching on the `sub` claim is brittle and prone to security problems). So we require publisher providers (OIDC IdPs) to provide distinct claims that we can match on. For GitHub and GitLab that's things like the repository name, workflow filename, etc., while for others it might be distinct username and immutable ID claims, etc.

This is all downstream of OIDC-driven federation being a much weaker and more bespoke process than all parties would like it to be. I think the discourse around this could be much improved by people taking the time to understand these complexities and why they pose a challenge to groups with limited engineering resources (like PyPI).

comment 1w ago · link · parent

Storing your private keys somewhere other than a regular file on disk is not a perpetual technical difficulty. Please assume good faith.

comment 1w ago · link · parent

> it's also AFAICT a permanent switch. once you put a single trusted/attested file up there, your account must now do all files in this way forever (or risk big red warnings. which maybe you're OK with that).

It's not[1].

> It would all be easier to take if trusted publishers weren't limited to solely large for-profit corporations (I'm too lazy to research if they're trying to fix this).

As mentioned in several other places, we're always interested in adding more publisher providers, provided they meet our key management and notability requirements.

(This is also the easiest way to reason abductively about PyPI's goals. If PyPI's goal was to support "large for-profit corporations," we'd have dozens of publisher providers of dubious quality and community value, rather than the small subset we currently have.)

[1]: https://discuss.python.org/t/pypis-new-security-indicators-a...

comment 1w ago · link · parent

That's probably a mobile bug (I can't reproduce it on a desktop browser). Could you open an issue here[1]?

[1]: https://github.com/pypi/warehouse/issues/new?template=bug-re...

comment 1w ago · link · parent

Support for Codeberg is being discussed here[1]. I think there's broad consensus among PyPI's maintainers and admins that more publisher providers are desired, but we also need them to demonstrate strong key management and rotation controls due to the degree of trust and access that becoming a publisher provider grants them (effectively, they become the PyPI credential broker for the projects that use their service).

(If you pan through that thread, you'll note that one of open issues with Codeberg is that their underlying server wants to store OIDC private keys on disk at the moment. This is okay for small deployments of personal services, but not for something that PyPI needs to federate with and trust.)

[1]: https://github.com/pypi/warehouse/issues/19786

comment 1w ago · link · parent

I’m talking about things like GHSAs. You can’t issue one just by compromising a push credential to a repository, which is how most of these supply chain attacks start.

comment 1w ago · link · parent

It adds nontrivial runtime cost. It’s also not a perfect mitigation (there are plenty of unsound patterns that ASan, UBSan, and TSan won’t catch).

comment 1w ago · link · parent

> If it’s just a box you check, it only means attackers will say “this is a security update” on the malicious package they upload.

It generally requires additional permissions, per the adjacent respond. And it introduces additional scrutiny on the release, which is the last thing an opportunistic attacker wants (the entire reason “supply chain” attacks are effective is because nobody gives any thought to upgrading their dependencies in the normal case).

12345
274