Skip to content

Commit 9fa302c

Browse files
committed
Fixed bug in Mutliple Security Header Check.js
Signed-off-by: Simon Bennetts <psiinon@gmail.com>
1 parent bf5135a commit 9fa302c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
## [Unreleased]
77
### Changed
88
- Add cautionary note to help and readme.
9+
### Fixed
10+
- Bug in 'Mutliple Security Header Check.js'.
911

1012
## [19] - 2024-07-01
1113
### Added

passive/Mutliple Security Header Check.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,21 @@ function scan(helper, msg, src) {
5050
"Most modern Web browsers support the X-Frame-Options HTTP header. Ensure it's set on all web pages returned by your site (if you expect the page to be framed only by pages on your server (e.g. it's part of a FRAMESET) then you'll want to use SAMEORIGIN, otherwise if you never expect the page to be framed, you should use DENY. ALLOW-FROM allows specific websites to frame the web page in supported web browsers).",
5151
"",
5252
];
53+
var responseHeader = msg.getResponseHeader().toString();
5354

5455
// test sts
5556
if (msg.getRequestHeader().isSecure()) {
56-
if (msg.getResponseHeader().getHeaders("Strict-Transport-Security") == null)
57+
if (
58+
msg.getResponseHeader().getHeaders("Strict-Transport-Security") == null
59+
) {
5760
helper
5861
.newAlert()
5962
.setName(alertTitle[0])
6063
.setDescription(alertDesc[0])
6164
.setSolution(alertSolution[0])
6265
.setMessage(msg)
6366
.raise();
67+
}
6468
}
6569
// test csp
6670
if (
@@ -69,14 +73,15 @@ function scan(helper, msg, src) {
6973
"X-Content-Security-Policy",
7074
"X-WebKit-CSP",
7175
])
72-
)
76+
) {
7377
helper
7478
.newAlert()
7579
.setName(alertTitle[1])
7680
.setDescription(alertDesc[1])
7781
.setSolution(alertSolution[1])
7882
.setMessage(msg)
7983
.raise();
84+
}
8085

8186
// test xxs protection
8287
var re_xss = /(X\-XSS\-Protection\:.+1)/g;

0 commit comments

Comments
 (0)