diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfCsrf.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfCsrf.xml
index b7cafff257..140fb7ab74 100644
--- a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfCsrf.xml
+++ b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfCsrf.xml
@@ -3,35 +3,31 @@
xmlns="http://pmd.sourceforge.net/rule-tests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
-
-
- 1
-
-]]>
- vf
-
-
-
- 0
-
-]]>
- vf
-
-
-
- 0
-
+ CSRF by starting a controller with an EL action
+ 1
+
+ ]]>
+ vf
+
+
+
+ Controller without actions is perfectly safe
+ 0
+
+ ]]>
+ vf
+
+
+
+ JS action on load is perfectly safe
+ 0
+
-]]>
- vf
-
+ ]]>
+ vf
+
diff --git a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfUnescapeEl.xml b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfUnescapeEl.xml
index fca8199fc3..d7313c8fab 100644
--- a/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfUnescapeEl.xml
+++ b/pmd-visualforce/src/test/resources/net/sourceforge/pmd/lang/vf/rule/security/xml/VfUnescapeEl.xml
@@ -3,691 +3,585 @@
xmlns="http://pmd.sourceforge.net/rule-tests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
-
-
- 1
-
+ apex:iframe with src pointing to VFEL
+ 1
+
-
+
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 1
-
+ html iframe with src pointing to VFEL
+ 1
+
-
+
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 1
-
+ html link with src pointing to VFEL
+ 1
+
- Link me
+ Link me
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 0
-
+ Safe escaped value in repeat
+ 0
+
-
-
-
-
+
+
+
+
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
-
- 0
-
+ Safe escaped value in repeat
+ 0
+
-
- emailTemplates.push({
- id: '{!template.id}',
- name: "{!JSENCODE(HTMLENCODE(template.name))}"
- });
-
+
+ emailTemplates.push({
+ id: '{!template.id}',
+ name: "{!JSENCODE(HTMLENCODE(template.name))}"
+ });
+
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
-
-
- 0
-
+ Safe case id in script
+ 0
+
-
+
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
-
- 0
-
+ Safely escaped case in script context
+ 0
+
-
+
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
-
-
- 0
-
+ Id in the EL means no XSS
+ 0
+
-foo
-
-]]>
- vf
-
-
-
-
- 0
-
-
+ foo
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 0
-
+ User Id is safe
+ 0
+
-
+
-]]>
- vf
-
-
-
- 1
-
+ vf
+
+
+
+ No XSS in safe script commands quoted context
+ 0
+
-
+
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 2
-
+ Unquoted EL in script tag is an XSS
+ 1
+
-
+
-]]>
- vf
-
-
-
- 0
-
+ vf
+
+
+
+ Quoted EL in script tag is an XSS
+ 2
+
-
+
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 0
-
+ Quoted and escaped EL in script tag is an XSS
+ 0
+
-
+
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
+ Quoted and escaped EL in script tag is an XSS
+ 0
+
-
+
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 1
-
+ Has multiple resources but starts with a safe one
+ 0
+
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 2
-
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
- ]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
-
- 1
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-{!NoXSSHere(bah)}
-
-]]>
- vf
-
-
-
-
- 0
-
-
+
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 1
-
+ Starts with Resource
+ 0
+
-
+
-
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 0
-
+ EL in JS on-event handler - stored XSS
+ 1
+
-
+
-
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 0
-
+ EL in JS on-event handler - stored XSS
+ 0
+
-
+
+
+
-
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 1
-
+ EL in img JS src handler - no XSS
+ 0
+
-
-
+
+
+ ]]>
+ vf
+
+
+
+ EL in JS src handler - stored XSS
+ 2
+
+
+
+
+ ]]>
+ vf
+
+
+
+ EL in JS src handler containing '/' literal - no stored XSS
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ EL in JS src handler prepended by starting with '/' literal - no stored XSS
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ EL in JS src handler - stored XSS
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ EL in JS src handler - stored XSS
+ 1
+
+
+
+ ]]>
+ vf
+
+
+
+ Default escaped EL - no XSS
+ 0
+
+ {!NoXSSHere(bah)}
+
+ ]]>
+ vf
+
+
+
+ EL that is properly escaped should be no XSS
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ XSS via EL identifier and no escaping
+ 1
+
+
+
+ ]]>
+ vf
+
+
+
+ XSS via EL literal and no escaping
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ XSS via EL boolean and no escaping
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ XSS via EL via param binding
+ 1
+
+
+
-
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
-
- 0
-
+ Escaped EL via param binding
+ 0
+
-
-
+
+
-
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 0
-
+ No XSS via EL via param binding
+ 0
+
-
-
+
+
-
-]]>
- vf
-
+ ]]>
+ vf
+
-
-
- 3
-
+ XSS via item value
+ 3
+
-
-
+
+
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-
-
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 1
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-
-
-]]>
- vf
-
-
-
-
- 0
-
-]]>
- vf
-
-
-
-
- 1
-
-]]>
+ ]]>
vf
-
+ XSS via item value
+ 0
+
+
+
+
+
+
+
+ ]]>
+ vf
+
+
+
+ No XSS with escaped EL
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ Quotes following quotes
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ Escaped followed by safe
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ Safe unquoted followed by safe quoted
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ NOT method evaluates to safe boolean
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ JSON.parse method evaluates quoted EL to safe JSON
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ JSON.parse method evaluates non quoted EL to unsafe XSS
+ 1
+
+
+
+ ]]>
+ vf
+
+
+
+ JSON.parse method evaluates escaped EL to safe JSON
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ $RemoteAction safe call
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ NOW() is a safe call
+ 0
+
+
+
+ ]]>
+ vf
+
+
+
+ URLENCODE is ignored as valid escape method #1100
+ 0
+
+ ]]>
+ vf
+
+
+
+ a onclick snippet should be escaped #1100
+ 1
+
+ ]]>
+ vf
+
+
+
+ ensure all encoding methods are considered valid #1100
0
-]]>
+ ]]>
vf
-