More test coverage

This commit is contained in:
Sergey
2017-03-02 15:51:57 -08:00
parent 32762c48d1
commit 6137baf615
2 changed files with 15 additions and 2 deletions

View File

@ -142,7 +142,7 @@ public class VfUnescapeElRule extends AbstractVfRule {
if (attrText != null) {
if (0 == attrText.jjtGetChildIndex()) {
if (attrText.getImage().startsWith("/")
|| attrText.getImage().toLowerCase().startsWith("http")) {
|| attrText.getImage().toLowerCase().startsWith("http") || attrText.getImage().toLowerCase().startsWith("mailto")) {
startingWithSlashText = true;
}
}

View File

@ -143,15 +143,28 @@ EL in JS on-event handler - stored XSS
<source-type>vf</source-type>
</test-code>
<test-code>
<description><![CDATA[
EL in img JS src handler - no XSS
]]></description>
<expected-problems>0</expected-problems>
<code><![CDATA[
<apex:page>
<img src="{!XSSHere}" />
</apex:page>
]]></code>
<source-type>vf</source-type>
</test-code>
<test-code>
<description><![CDATA[
EL in JS src handler - stored XSS
]]></description>
<expected-problems>1</expected-problems>
<expected-problems>2</expected-problems>
<code><![CDATA[
<apex:page>
<iframe src="{!XSSHere}" />
<a href="{!XSSHere}" />
</apex:page>
]]></code>
<source-type>vf</source-type>