Hi.
I think Aiko's explanation is correct. I'd like to put some historical and additional info on this word. (Note: I'm considered kaseki (or fossil) since I've been away for many many years).
Yabai originally meant (when I was in Japan) "bad" in the sense "bad" that one will get in trouble. For example, when you are a student, smoking is prohibited. So one says 学校でタバコを吸うとやばいよ。(gakkou de tabako wo suu to yabai yo, or if you smoke, you will get in trouble (from teachers, parents, etc)). That's how it was used. Again, it's a slang so you won't see this in writing. But this word has evolved to mean other things as Aiko-san has explained. I hope this helps.