33 lines
720 B
Plaintext
33 lines
720 B
Plaintext
include::../description.adoc[]
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
== Sensitive Code Example
|
|
|
|
With https://github.com/samskivert/jmustache[JMustache by samskivert]:
|
|
|
|
----
|
|
Mustache.compiler().escapeHTML(false).compile(template).execute(context); // Sensitive
|
|
Mustache.compiler().withEscaper(Escapers.NONE).compile(template).execute(context); // Sensitive
|
|
----
|
|
With https://freemarker.apache.org/[Freemarker]:
|
|
|
|
----
|
|
TODO
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
Mustache.compiler().compile(template).execute(context); // Compliant, auto-escaping is enabled by default
|
|
Mustache.compiler().escapeHTML(true).compile(template).execute(context); // Compliant
|
|
----
|
|
|
|
----
|
|
TODO
|
|
----
|
|
|
|
include::../see.adoc[]
|