I personally use ((...)) for arithmetic tests and [[...]] for all other tests as I just target new versions of BASH and don't care much about POSIX compatibility.
reply
This can evaluate arbitrary code: [[ "${payload}" -eq 42 ]]
Here is one example of a malicious payload:
payload='a[$(touch /tmp/pwned)]'
Now I need to figure out whether (( payload == 42 )) is safe.