Skip to content

Commit 95336cc

Browse files
committed
Sync HTTP Response Code Errors script from zaproxy
Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>
1 parent 07d3e63 commit 95336cc

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1717
- Maintenance and documentation changes.
1818
- Active and passive READMEs to include lastest JS script examples.
1919
- Reduce usage of fully qualified objects in loops or main methods to address potential classloader performance issues, in JavaScript scripts (Issue 9187).
20+
- httpsender/Alert on HTTP Response Code Errors.js sync from zaproxy (Issue 9273).
2021

2122
### Fixed
2223
- The following scripts were not being loaded as scan rules:
2324
- active/SSTI.js
2425
- passive/Mutliple Security Header Check.js
25-
- Updated Alert_on_HTTP_Response_Code_Errors.js to work with GraalVM JavaScript engine.
26+
- Updated Alert on HTTP Response Code Errors.js to work with GraalVM JavaScript engine.
2627

2728
### Removed
2829
- Links to videos which no longer exist.

httpsender/Alert on HTTP Response Code Errors.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ function responseReceived(msg, initiator, helper) {
3434
} else {
3535
var risk = 0; // Info
3636
var title = "A Client Error response code was returned by the server";
37+
var alertRef = 1;
3738
if (code >= 500) {
3839
// Server error
3940
risk = 1; // Low
4041
title = "A Server Error response code was returned by the server";
42+
alertRef = 2;
4143
}
4244
// CONFIDENCE_HIGH = 3 (we can be pretty sure we're right)
4345
var alert = new Alert(pluginid, risk, 3, title);
@@ -95,6 +97,7 @@ function responseReceived(msg, initiator, helper) {
9597
"Raised by the 'Alert on HTTP Response Code Error' script"
9698
);
9799
alert.setEvidence(code.toString());
100+
alert.setAlertRef(pluginid + "-" + alertRef);
98101
alert.setCweId(388); // CWE CATEGORY: Error Handling
99102
alert.setWascId(20); // WASC Improper Input Handling
100103
extensionAlert.alertFound(alert, ref);

0 commit comments

Comments
 (0)