Skip to content

Commit e41b625

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

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ 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:

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)