Skip to content

Commit 301c65c

Browse files
authored
Merge pull request #253 from kingthorin/cve202141773-apache-2
fix: cve-2021-41773-apache-path-trav.js set path escaped
2 parents d8065b5 + c87ec12 commit 301c65c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ All notable changes to this add-on will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
## [Unreleased]
7-
7+
### Fixed
8+
- targeted/cve-2021-41773-apache-path-trav.js - Set path as escaped so that it's handled properly, set pluginid properly.
89

910
## [12] - 2021-10-07
1011
### Added

targeted/cve-2021-41773-apache-path-trav.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function invokeWith(msg) {
4040
// To check if script is running
4141
logger("Testing Script against URL - " + url);
4242

43-
msg.getRequestHeader().getURI().setPath(attackPath);
43+
msg.getRequestHeader().getURI().setEscapedPath(attackPath);
4444
var connectionParams = Model.getSingleton().getOptionsParam().getConnectionParam();
4545
var sender = new HttpSender(connectionParams, true, 6);
4646
sender.sendAndReceive(msg);
@@ -53,7 +53,6 @@ function invokeWith(msg) {
5353
re.lastIndex = 0
5454
var alertEvidence = re.exec(rebody);
5555
customAlert(
56-
pluginid,
5756
3, // risk: 0: info, 1: low, 2: medium, 3: high
5857
3, // confidence: 0: falsePositive, 1: low, 2: medium, 3: high, 4: confirmed
5958
alertName,
@@ -75,11 +74,11 @@ function invokeWith(msg) {
7574
* Raise an alert.
7675
* @see https://www.javadoc.io/doc/org.zaproxy/zap/latest/org/parosproxy/paros/core/scanner/Alert.html
7776
*/
78-
function customAlert(pluginid, alertRisk, alertConfidence, alertName, alertDesc, alertAttack, alertEvidence, alertSol, alertReference, cweId, wascId, msg, url) {
77+
function customAlert(alertRisk, alertConfidence, alertName, alertDesc, alertAttack, alertEvidence, alertSol, alertReference, cweId, wascId, msg, url) {
7978
var extensionAlert = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.NAME);
8079
var ref = new HistoryReference(session, HistoryReference.TYPE_ZAP_USER, msg);
8180

82-
var alert = new org.parosproxy.paros.core.scanner.Alert(pluginid, alertRisk, alertConfidence, alertName);
81+
var alert = new org.parosproxy.paros.core.scanner.Alert(-1, alertRisk, alertConfidence, alertName);
8382
alert.setDescription(alertDesc);
8483
alert.setAttack(alertAttack);
8584
alert.setEvidence(alertEvidence);

0 commit comments

Comments
 (0)