Safety concerns with foreign apps transaction parameter

That’s a very good point.
TEAL v3 is fixing this issue by adding the array “Applications” of Foreign Apps to txna:

It’s available on BetaNet right now

See specs: https://github.com/algorandfoundation/specs/blob/ac2255d586c4474d4ebcf3809acccb59b7ef34ff/dev/TEAL.md#arithmetic-logic-and-cryptographic-operations