|
1 | 1 | const express = require('express'); |
2 | 2 | const libxmljs = require('libxmljs'); |
3 | 3 |
|
4 | | -express().get('/some/path', function(req) { |
| 4 | +express().get('/some/path', function (req) { |
5 | 5 | // NOT OK: unguarded entity expansion |
6 | | - libxmljs.parseXml(req.param("some-xml"), { noent: true }); |
| 6 | + libxmljs.parseXml(req.param("some-xml"), { noent: true }); // $ Alert |
7 | 7 | }); |
8 | 8 |
|
9 | | -express().post('/some/path', function(req, res) { |
| 9 | +express().post('/some/path', function (req, res) { |
10 | 10 | // NOT OK: unguarded entity expansion |
11 | | - libxmljs.parseXml(req.param("some-xml"), { noent: true }); |
| 11 | + libxmljs.parseXml(req.param("some-xml"), { noent: true }); // $ Alert |
12 | 12 |
|
13 | 13 | // NOT OK: unguarded entity expansion |
14 | | - libxmljs.parseXmlString(req.param("some-xml"), {noent:true}) |
| 14 | + libxmljs.parseXmlString(req.param("some-xml"), { noent: true }) // $ Alert |
15 | 15 | // NOT OK: unguarded entity expansion |
16 | | - libxmljs.parseXmlString(req.files.products.data.toString('utf8'), {noent:true}) |
17 | | - |
| 16 | + libxmljs.parseXmlString(req.files.products.data.toString('utf8'), { noent: true })// $ Source=files $ Alert=files |
| 17 | + |
18 | 18 | // OK - no entity expansion |
19 | | - libxmljs.parseXmlString(req.files.products.data.toString('utf8'), {noent:false}) |
| 19 | + libxmljs.parseXmlString(req.files.products.data.toString('utf8'), { noent: false }) |
20 | 20 | }); |
0 commit comments