Skip to content

Commit bb8cb94

Browse files
committed
[4.4.x] Remove potential local RPSL password log from irr_rpsl_submit
Fixes https://github.com/irrdnet/irrd/security/code-scanning/3 (cherry picked from commit 4f5ac12)
1 parent a78f79e commit bb8cb94

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

irrd/scripts/irr_rpsl_submit.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,12 @@ def create_http_request(requests_text, args):
564564
method=method,
565565
headers=headers,
566566
)
567-
logger.debug("Submitting to %s; method %s}; headers %s; data %s", url, method, headers, http_data)
567+
filtered_http_data = http_data
568+
for password in request_body.get("passwords", []): # pragma: no cover
569+
filtered_http_data.replace(password, b"REMOVED")
570+
logger.debug(
571+
"Submitting to %s; method %s}; headers %s; data %s", url, method, headers, filtered_http_data
572+
)
568573

569574
return http_request
570575

@@ -760,7 +765,7 @@ def send_request(requests_text, args):
760765
raise XHTTPConnectionFailed(args.url, http_request) from error # pragma: no cover
761766
if reason == "Not Found":
762767
raise XHTTPNotFound(args.url, http_request) from error
763-
raise error
768+
raise error # pragma: no cover: CI glitch workaround
764769
except Exception as error:
765770
raise error
766771

0 commit comments

Comments
 (0)