Ever edit a PDF in MacOS Preview and have it mysteriously go password protected, effectively locking you out?

It's been a bug for at least two years, and the workaround I've found is to edit the PDF in Chrome instead – which you can still do even after the MacOS password has been inflicted on it. Which I have many questions about.

PDF is the gift that keeps on giving.

https://www.reddit.com/r/mac/comments/10fxqr0/mac_set_password_on_my_pdf_file_without_my/

@daveshea
For whatever reason, this has never happened to me, but I'm bookmarking this nonetheless
@daveshea The problem I have encountered is that digital signatures in a PDF are stripped out and turned into images, and any remaining digital signature blocks are similarly neutered. And Mac users are just like "what, did I break it?" Guh.
@daveshea Permissions in PDF (format) are advisory. The renderer is expected to respect and enforce them. There’s nothing in the format to prevent the renderer from ignoring them. I suspect that is exactly what Chrome does.
@daveshea PDFs have two passwords, "open" and "modify". The first cryptographically encrypts the PDF, the second uses a null key so it's up to the reading software to honor any modification restrictions set. So that explains the behavior if not why Apple is deciding to set the modify password.
@daveshea I haven’t run into this bug myself, but I did create an automation that might help https://goykhman.ca/gene/blog/2023-12-28-read-only-pdfs.html
Flaky Goodness

@daveshea late to the party but if you "print" the PDF to a PDF file which doesn't make any sense :-) then you can edit the "printed" PDF in preview.