Advisor drops MSci student suddenly in final semester
Advise your colleague to take this up with whatever graduate student support is available at your institution.
As a fellow student, there probably isn't a productive way for you to intervene directly. You don't have any official role or reason for involvement, and any action you can take could be taken more effectively by the student herself.
The situation you describe is quite troubling. If this is the whole story, then action ought to be taken (and hopefully the university will support the student). But she really needs to be her own advocate here.
However, keep in mind that you only know one side of the story. Even though you think quite highly of this student, you need to be cautious in jumping to conclusions. Sometimes (though not always) when something seems inexplicable, it's because there is more to it than meets the eye. So I would be careful not to take any rash actions. Don't let this unduly affect your professional relationship with your adviser.
A demand for secrecy from a person in power usually means real trouble. Some kind of shenanigans are afoot. Sex? Drugs? Rock'n'roll? Research fraud? Plagiarism? Seriously, something is wrong. And, it's not clear who is responsible for starting and continuing these shenanigans. It could be WW or QQ or other people.
So, be careful. If I were you, I'd refrain from personally intervening in this situation except to offer support and advice to your colleague.
If I were your colleague, I'd let the Professor WW know that the demand for secrecy is unreasonable, and even unconscionable. Your colleague is spending her time and energy, and the money she's getting either from a fellowship or her own funds, to get an education. She's a customer in that sense.
Your department and your institution owe QQ that education. The institution's plan A to educate her is to assign her to Professor WW. If plan A isn't going to work, it is the institution's obligation to to come up with plan B, and see that it's carried out. Professor WW can help coming up with plan B. But the department owns the plan, not WW.
If QQ has violated an academic or personal standard, it is the department's and institution's responsibility to handle that violation. Professor WW cannot just sweep it under the rug, especially by offering secrecy.
WW doesn't have the right to conceal this situation from the department. Your colleague should refuse to let her do that.
Graduate students aren't handwringing supplicants begging for scraps that fall from the banquet table of academe. You are adult learners with life plans. This is especially true of MS students. Graduate degree programs exist to serve these adult learners. I hope QQ can claim her rightful place.
It's not clear who started and continued these shenanigans, but it is clear that ending them is going to be difficult unless everybody cooperates. To cooperate, they have to stop keeping secrets.
Let's hope Dr. New-Department-Leader takes QQ on for the remaining semester.
What can QQ do? Meet with the department head or the dean of graduate studies, and ask him/her to discreetly look into the problem. Prof. WW has no right to ask QQ to keep these types of secrets, and QQ may safely speak openly to one department administrator about what happened.
What can you do? You can offer to QQ your willingness to go along to that meeting for moral support. If you do, you should explicitly request that your presence in the meeting not be revealed to your advisor.
I cannot imagine this resulting in your being blacklisted or harmed in any way, if this is in the U.S.
If I were in QQ's shoes, your presence in that meeting, and your taking the initiative to offer that support, would mean a lot to me.
It is not for me to say what you should do. That is a very personal decision.
In addition, you can make yourself available to QQ as a supportive fellow student and friend.