A misconfigured database in a popular AI app left 300 million private messages wide open to the world.