Thanks to @Fraccaman, we found out that the new implementation of replay protection implemented in #1280 manages the wrapper tx correctly but fails to safely protect the inner tx. This is because we are currently taking the hash of the header which could be easily changed by modifying some less important fields (like the timestamp) to force multiple applications of the same wasm code and the associated data.
To fix it we should simply save in storage the hash of the data (which is already available in the header) together with the hash of the entire header (to protect the wrapper).
Thanks to @Fraccaman, we found out that the new implementation of replay protection implemented in #1280 manages the wrapper tx correctly but fails to safely protect the inner tx. This is because we are currently taking the hash of the header which could be easily changed by modifying some less important fields (like the timestamp) to force multiple applications of the same wasm code and the associated data.
To fix it we should simply save in storage the hash of the data (which is already available in the header) together with the hash of the entire header (to protect the wrapper).