From: Mike Samuel Date: Wed, 28 Sep 2011 20:32:56 +0000 (-0700) Subject: exp/template/html: don't normalize '<' in doctypes. X-Git-Tag: weekly.2011-10-06~70 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=582bb304662f2da08f99bf7d05d3fbb634bb531b;p=gostls13.git exp/template/html: don't normalize '<' in doctypes. The normalization that prevents element name and comment injection in <{{.}} by converting it to <{{.}} breaks Instead of splitting states to have a start of document state and a text state, I whitelist ", } +var doctypeBytes = []byte("b", "a<b", }, + { + "HTML doctype not normalized", + "Hello, World!", + "Hello, World!", + }, + { + "No doctype injection", + `Hello, {{.C}}{{else}}world -->{{.W}}{{end}}",