By looking at https://letsencrypt.org/how-it-works/, I got the feeling that a man-in-the-middle attack might be possible in the 'Domain Validation' phase.
During that phase, the admin is asked to e.g. perform the challenge of putting a file on the webserver and sending a signed nonce to the CA. What if a man-in-the-middle generated his own (authorization) key pair (while the admin is performing the domain validation) and signed the nonce with the malicious key pair? The admin would have performed the challenge by posting a file on the server and the CA would have gotten a maliciously signed nonce (if the man-in-the-middle is able to discard the signed nonce from the admin). This would mean a compromised authorization key in control of the man-in-the-middle for a domain.
The solution (in my opinion) would be to simply post the signed nonce on the Website (on a path decided by the CA) instead of sending it to the CA, such that the "signature swap" cannot happen. This however is not depicted on the Let's Encrypted "How it works" explanation.
Am I understanding something wrong or how is such an attack prevented?