Skip to content

Commit 6bf1c05

Browse files
committed
[Dependencies] Upgrade Werkzeug from version 2.0.* to version 3.0.3 to address vulnerability https://github.com/aws/aws-parallelcluster/security/dependabot/9.
Signed-off-by: Giacomo Marciani <[email protected]>
1 parent fac752f commit 6bf1c05

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

THIRD-PARTY-LICENSES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
675675
Copyright 2007 Pallets
676676
** Flask; version 2.2.5 -- https://palletsprojects.com/p/flask
677677
Copyright 2010 Pallets
678-
** Werkzeug; version 2.3.8 -- https://pypi.org/project/Werkzeug/
678+
** Werkzeug; version 3.0.3 -- https://pypi.org/project/Werkzeug/
679679
Copyright 2007 Pallets
680680

681681
Redistribution and use in source and binary forms, with or without

cli/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jsii==1.85.0
2424
marshmallow~=3.10
2525
PyYAML>=5.3.1,!=5.4
2626
tabulate>=0.8.8,<=0.8.10
27-
werkzeug~=2.0
27+
werkzeug==3.0.3

cli/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def readme():
4646
"aws-cdk.aws-ssm~=" + CDK_VERSION,
4747
"aws-cdk.aws-sqs~=" + CDK_VERSION,
4848
"aws-cdk.aws-cloudformation~=" + CDK_VERSION,
49-
"werkzeug~=2.0",
49+
"werkzeug==3.0.3",
5050
"connexion~=2.13.0",
5151
"flask>=2.2.5,<2.3",
5252
"jmespath~=0.10",

cli/src/pcluster/api/awslambda/serverless_wsgi.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from werkzeug.datastructures import Headers, MultiDict, iter_multi_items
2222
from werkzeug.http import HTTP_STATUS_CODES
23-
from werkzeug.urls import url_encode, url_unquote, url_unquote_plus
23+
from urllib.parse import urlencode, unquote, unquote_plus
2424
from werkzeug.wrappers import Response
2525

2626
# List of MIME types that should not be base64 encoded. MIME types within `text/*`
@@ -95,8 +95,8 @@ def encode_query_string(event):
9595
if not params:
9696
params = ""
9797
if is_alb_event(event):
98-
params = MultiDict((url_unquote_plus(k), url_unquote_plus(v)) for k, v in iter_multi_items(params))
99-
return url_encode(params)
98+
params = MultiDict((unquote_plus(k), unquote_plus(v)) for k, v in iter_multi_items(params))
99+
return urlencode(params)
100100

101101

102102
def get_script_name(headers, request_context):
@@ -203,7 +203,7 @@ def handle_payload_v1(app, event, context):
203203
environ = {
204204
"CONTENT_LENGTH": str(len(body)),
205205
"CONTENT_TYPE": headers.get("Content-Type", ""),
206-
"PATH_INFO": url_unquote(path_info),
206+
"PATH_INFO": unquote(path_info),
207207
"QUERY_STRING": encode_query_string(event),
208208
"REMOTE_ADDR": event.get("requestContext", {}).get("identity", {}).get("sourceIp", ""),
209209
"REMOTE_USER": event.get("requestContext", {}).get("authorizer", {}).get("principalId", ""),
@@ -247,7 +247,7 @@ def handle_payload_v2(app, event, context):
247247
environ = {
248248
"CONTENT_LENGTH": str(len(body)),
249249
"CONTENT_TYPE": headers.get("Content-Type", ""),
250-
"PATH_INFO": url_unquote(path_info),
250+
"PATH_INFO": unquote(path_info),
251251
"QUERY_STRING": event.get("rawQueryString", ""),
252252
"REMOTE_ADDR": event.get("requestContext", {}).get("http", {}).get("sourceIp", ""),
253253
"REMOTE_USER": event.get("requestContext", {}).get("authorizer", {}).get("principalId", ""),
@@ -295,8 +295,8 @@ def handle_lambda_integration(app, event, context):
295295
environ = {
296296
"CONTENT_LENGTH": str(len(body)),
297297
"CONTENT_TYPE": headers.get("Content-Type", ""),
298-
"PATH_INFO": url_unquote(path_info),
299-
"QUERY_STRING": url_encode(event.get("query", {})),
298+
"PATH_INFO": unquote(path_info),
299+
"QUERY_STRING": urlencode(event.get("query", {})),
300300
"REMOTE_ADDR": event.get("identity", {}).get("sourceIp", ""),
301301
"REMOTE_USER": event.get("principalId", ""),
302302
"REQUEST_METHOD": event.get("method", ""),

0 commit comments

Comments
 (0)