This code might expose sensitive information to an actor who is not explicitly authorized to have access to the information. This could have serious consequences depending on the type of information revealed and how attackers can use the information.
1var express = require('express')
2var helmet = require('helmet')
3var app = express()
4function sensitiveInformationLeakNoncompliant(){
5 app.use(
6 helmet.referrerPolicy({
7 // Noncompliant: sets the policy as no-referrer-when-downgrade.
8 policy: 'no-referrer-when-downgrade'
9 })
10 )
11}
1var express = require('express')
2var helmet = require('helmet')
3var app = express()
4function sensitiveInformationLeakCompliant(){
5 app.use(
6 helmet.referrerPolicy({
7 // Compliant: sets the policy as no-referrer.
8 policy: 'no-referrer'
9 })
10 )
11}