You can relicense code. Though that doesn’t mean that you can take anything away. You just open another avenue for people to use what you wrote and developed, and any old license still exists and retains validity; the way you can curtail rights is by not granting liberal terms on newly created code.
This is how macOS switched to zsh, and left all GNU code in it to rot.





Thanks to the wonders of capitalism, a bunch of businesses that would have to yield to tyrannical open source devs and their goody-two-shoes mentality can pool their bargaining power and each pay a little to a benevolent clean room reimplementer of security fixes.
Or, they can vendor the library and ask Claude to fix it in-tree 🤷