Amazon has addressed a security hole that enabled attackers to inject malicious code into the company’s website and potentially compromise user accounts, a researcher reported on Tuesday.