What SE can do is controlled primarily by the Terms of Service. What most matters is the section on Subscriber Content, which says:
You agree that any and all content, including without limitation any
and all text, graphics, logos, tools, photographs, images,
illustrations, software or source code, audio and video, animations,
and product feedback (collectively, “Content”) that you provide to the
public Network (collectively, “Subscriber Content”), is perpetually
and irrevocably licensed to Stack Overflow on a worldwide,
royalty-free, non-exclusive basis pursuant to Creative Commons
licensing terms (CC-BY-SA), and you grant Stack Overflow the perpetual
and irrevocable right and license to access, use, process, copy,
distribute, export, display and to commercially exploit such
Subscriber Content, even if such Subscriber Content has been
contributed and subsequently removed by you...
This means that you cannot revoke permission for Stack Overflow to
publish, distribute, store and use such content and to allow others to
have derivative rights to publish, distribute, store and use such
content. The CC-BY-SA Creative Commons license terms are explained in
further detail by Creative Commons, but you should be aware that all
Public Content you contribute is available for public copy and
redistribution, and all such Public Content must have appropriate
This part has not changed: the purported license is still "CC-BY-SA", and the TOS does not explicitly specify a version. What apparently has changed in the relevant section is one "helpful information" link, which now points to https://creativecommons.org/licenses/by-sa/4.0/. So the interesting question arises whether that would constitute an unpermitted post-hoc change in the terms by which SE has license to my older stuff. This matter came up in a reviled Meta question; as I pointed out, the TOS also included a merger clause that
to time, constitutes the entire agreement between You, the Network and
Stack Exchange with respect to the subject matter hereof. This
Agreement replaces all prior or contemporaneous understandings or
agreements, written or oral, regarding the subject matter hereof.
Because of that, the TOS is self-contained and stuff found on other web pages are not part of the agreement. This in itself is a bit of a problem because you can't both say "we're not bound by stuff outside of this page" and say "the specific terms of the license are outside this page".
That particular clause is gone, but there is an analog in the current TOS:
These Public Network Terms represent the entire agreement between you
and Stack Overflow and supersede all prior or contemporaneous oral or
written communications, proposals, and representations with respect to
the public Network or Services or Products contemplated hereunder.
Furthermore, the TOS contains the following "we can change it" clause:
Stack Overflow reserves the right, in its sole discretion, to modify
or replace these Public Network Terms, as our business evolves over
time and to better provide Services and Products to the Stack Overflow
community, or to change, suspend, or discontinue the public Network
and/or any Services or Products at any time by posting a notice on the
public Network or by sending you notice via e-mail or by another
appropriate means of electronic communication.
I assume but do not know for a fact that a similar clause existed in prior versions of the TOS. So I conclude that the change is legal.