I have unprotected JSPs which have XSS holes. I need to replace all ${...}
strings which are not already inside a <c:out value="${...}" />
tag by a <c:out value="${...}" />
.
For example,
<select>
<option value="${foo}">label</option>
</select>
${bar}
<c:out value="${message}" />
needs to be regex-replaced to the following:
<select>
<option value="<c:out value="${foo}" />">label</option>
</select>
<c:out value="${bar}" />
<c:out value="${message}" />