File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
cpp/ql/test/query-tests/Security/CWE/CWE-611 Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -21,5 +21,6 @@ class XMLUni
21
21
{
22
22
public:
23
23
static const XMLCh fgXercesDisableDefaultEntityResolution[];
24
+ static const XMLCh fgXercesHarmlessOption[];
24
25
};
25
26
Original file line number Diff line number Diff line change @@ -55,3 +55,28 @@ void test3_5(InputSource &data) {
55
55
test3_5_init ();
56
56
p_3_5->parse (data); // GOOD
57
57
}
58
+
59
+ void test3_6 (InputSource &data) {
60
+ SAX2XMLReader *p = XMLReaderFactory::createXMLReader ();
61
+
62
+ p->setFeature (XMLUni::fgXercesDisableDefaultEntityResolution, false );
63
+ p->parse (data); // BAD (parser not correctly configured) [NOT DETECTED]
64
+ }
65
+
66
+ void test3_7 (InputSource &data) {
67
+ SAX2XMLReader *p = XMLReaderFactory::createXMLReader ();
68
+
69
+ p->setFeature (XMLUni::fgXercesHarmlessOption, true );
70
+ p->parse (data); // BAD (parser not correctly configured) [NOT DETECTED]
71
+ }
72
+
73
+ void test3_8 (InputSource &data) {
74
+ SAX2XMLReader *p = XMLReaderFactory::createXMLReader ();
75
+ const XMLCh *feature = XMLUni::fgXercesDisableDefaultEntityResolution;
76
+
77
+ p->setFeature (feature, true );
78
+ p->parse (data); // GOOD
79
+ }
80
+
81
+
82
+
You can’t perform that action at this time.
0 commit comments