That said, with the latest development, I'm not even sure whether the STARK mentioned in the post is safe.
What you described doesn't bind to new_pub so someone could see your transaction and then frontrun it with a replaced new_pub.
That's why you need a STARK to prove that you know $(g(h...l(master_key)) without revealing it, and this STARK has to bind new_pub.