I think this is not a mustache problem, if you follow the philosophy of "small, sharp tools." Then, before matching unsafe data (third-party JSON) with the template, you should check the data using other tools.
The easiest way to get started is to replace string fields containing insecure data.
function clearJson(userStringData){ return JSON.parse(userStringData, function(k,v) {
The code entry field is too large to get a short answer to your question. You can take any approach that is advanced enough for your application: determine the data formats expected from the user, and then at runtime delete incoming suspicious data that does not match these formats.
source share