It is considered to be secure if an appropriate mathematical group is used. However it is vulnerable to the [man in the middle attack]? in which the attacker is able to modify messages between Alice and Bob as well as read them.
Diffie-Hellman key exchange was invented in 1975 or 1976 during a collaboration between [Whitfield Diffie]?, [Martin Hellman]? and Ralph Merkle and was the first public proposal for establishing a shared secret over an unprotected communications channel. It had been discovered by Malcolm Williamson of GCHQ in the UK some years previously, but GCHQ chose not make it public until 1997, by which time it had no influence on research.
There are many others now proposed or in use, and some of them are apparently immune to "Man in the middle" attacks.
The method was followed shortly afterwards by the invention of public key cryptography using asymmetric algorithms.