Local folktales and legends commonly have an answer for everything. Although they are not scientifically correct, it is still entertaining to know how some things came about from a mythical point of view.

Here is a legend of how the cobra got its venom according to a legend recorded from Ulu Kedup, Sarawak:
Long time ago, there was a black fish called the ikan dudok. This fish was the most poisonous of creatures, so much so that if a man’s shadow even fell on a pool in which the ikan dudok was lurking, the man would immediately die.
The cobra, although a wise and cunning beast, in those days had no weapons of defence, but wore in the centre of his head a bright jewel.
One day, the cobra sidled up to the pool where the ikan dudok lay and hissed. “Oh black fish! Are you not ashamed of the deaths you caused? You are a stupid fish, unfit to have this virulent poison which you use so indiscriminately.”
The cobra then asked the fish to give its poison in exchange for the bright jewel on his head.
Then the cobra reared up his head in the sun and the fish saw the sparkling jewel.
He agreed to the exchange, vomiting out the poison on a handy leaf. In the meantime, the cobra gave up its jewel (which of course, was not a real diamond).
“Good!” said the cobra, “Now I promise you that I will not spread death with this poison as you have; I will only strike men in their eyes or on their big toe.”
Thus to this day, the cobra rears up proudly to search for his victims’ eyes. Meanwhile, the legend also explains why you can find a white stone in the head of every ikan dudok.
As for the leaf that the fish chose to vomit on, its poison is called daun api. One can get a painful rash with just a brush from this leaf.