How is a Transaction protected from tampering before inclusion in a Block?
The entire transaction (except for the signatures) must be signed with the appropriate key for each transaction output it claims. Tampering with any of the outputs with invalidate all the signatures.