Skip to content

Commit

Permalink
fix(JS tests): fix outdated testdata (#722)
Browse files Browse the repository at this point in the history
fix: fix outdated testdata
  • Loading branch information
elsapet authored Mar 3, 2023
1 parent d48862a commit 3b65905
Show file tree
Hide file tree
Showing 27 changed files with 117 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 6
line_number: 11
filename: insecure_dot_template.js
parent_line_number: 6
parent_line_number: 11
parent_content: doT.template(req.params.template)


Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 6
line_number: 11
filename: insecure_ejs_template.js
parent_line_number: 6
parent_line_number: 11
parent_content: ejs.compile(req.body.user, options)
- rule:
cwe_ids:
- "1336"
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 11
line_number: 16
filename: insecure_ejs_template.js
parent_line_number: 11
parent_line_number: 16
parent_content: ejs.render(req.params.name, data, options)


Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 7
line_number: 12
filename: insecure_eta_template.js
parent_line_number: 7
parent_line_number: 12
parent_content: 'Eta.render(req.params, { name: "insecure" })'


Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 8
line_number: 13
filename: insecure_express_hbs_template.js
parent_line_number: 8
parent_line_number: 13
parent_content: hbs.renderView(req.params.viewPath, options, (err) => {})


Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 7
line_number: 12
filename: insecure_handlebars_template.js
parent_line_number: 7
parent_line_number: 12
parent_content: Handlebars.precompile(req.body.user, options)
- rule:
cwe_ids:
- "1336"
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 8
line_number: 13
filename: insecure_handlebars_template.js
parent_line_number: 8
parent_line_number: 13
parent_content: Handlebars.compile(req.body.user, options)


Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 8
line_number: 13
filename: insecure_hoganjs_template.js
parent_line_number: 8
parent_line_number: 13
parent_content: 'Hogan.compile(template, { name: "insecure" })'


Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 8
line_number: 13
filename: insecure_liquid_template.js
parent_line_number: 8
parent_line_number: 13
parent_content: 'engine.render(req.params.text, { hello: "world" })'


Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 6
line_number: 11
filename: insecure_lodash_template.js
parent_line_number: 6
parent_line_number: 11
parent_content: _.template(req.params.body)


Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 7
line_number: 12
filename: insecure_mustache_template.js
parent_line_number: 7
parent_line_number: 12
parent_content: 'Mustache.render(req.params, { name: "insecure" })'


Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 6
line_number: 11
filename: insecure_nunjucks_template.js
parent_line_number: 6
parent_line_number: 11
parent_content: nunjucks.render(req.params.body)
- rule:
cwe_ids:
- "1336"
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 7
line_number: 12
filename: insecure_nunjucks_template.js
parent_line_number: 7
parent_line_number: 12
parent_content: nunjucks.renderString(req.params.body)


Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 7
line_number: 12
filename: insecure_pug_template.js
parent_line_number: 7
parent_line_number: 12
parent_content: pug.render(req.params.name, merge(options, locals))
- rule:
cwe_ids:
- "1336"
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 11
line_number: 16
filename: insecure_pug_template.js
parent_line_number: 11
parent_line_number: 16
parent_content: pug.compile(req.params.name)


Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 7
line_number: 12
filename: insecure_squirrelly_template.js
parent_line_number: 7
parent_line_number: 12
parent_content: 'Sqrl.render(req.params.text, { name: "alvin" })'


Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ low:
id: javascript_express_insecure_template_rendering
description: Insecure template rendering detected.
documentation_url: https://docs.bearer.com/reference/rules/javascript_express_insecure_template_rendering
line_number: 8
line_number: 13
filename: insecure_whiskers_template.js
parent_line_number: 8
parent_line_number: 13
parent_content: whiskers.render(req.params.text, context)


Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())

const doT = require('dot');

app.get("/bad", (req, _res) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())

const ejs = require('ejs');

app.get("/bad", (req, _res) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())


import * as Eta from "eta";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())


import { create } from 'express-handlebars';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())


import * as Handlebars from "handlebars";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())


const Hogan = require("hogan.js");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())


import { Liquid } from 'liquidjs'
const engine = new Liquid()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())

const _ = require('lodash');

app.get("/bad", (req, _res) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())


const Mustache = require('mustache');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())

const nunjucks = require('nunjucks');

app.get("/bad", (req, _res) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())


var pug = require('pug');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())


var Sqrl = require("squirrelly");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())


var whiskers = require("whiskers");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const express = require("express");
const app = express();
var helmet = require("helmet")

var app = express()
app.use(helmet())
app.use(helmet.hidePoweredBy())

// pug
var pug = require('pug');
Expand Down

0 comments on commit 3b65905

Please sign in to comment.