Security: validate ephemeral values

Fixing iSEC finding no. 14.