Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
382b4d5
chore: patch libxml2 cve
bnpaws Sep 12, 2025
d0f6fcc
Update ['dlc_developer_config.toml']
bnpaws Sep 12, 2025
0adca20
adding linux-libc-dev
bnpaws Sep 15, 2025
99c0238
Merge branch 'master' into libxml_pytorch_inf
bnpaws Sep 15, 2025
f4c4237
pinning pluggy to correct version
bnpaws Sep 15, 2025
7939753
allowlist py vuln
bnpaws Sep 16, 2025
8e142fd
Revert "pinning pluggy to correct version"
bnpaws Sep 16, 2025
6cf02ce
Merge branch 'master' into libxml_pytorch_inf
bnpaws Sep 16, 2025
0b8dbcf
moving allowlist file
bnpaws Sep 16, 2025
cd6af7d
adding to ignore list
bnpaws Sep 16, 2025
0aba4de
updating py version
bnpaws Sep 17, 2025
6e49d16
correct data file
bnpaws Sep 17, 2025
40a08c9
correct data file
bnpaws Sep 17, 2025
f450782
fix requirements.py
bnpaws Sep 17, 2025
60fe472
fix tests
bnpaws Sep 17, 2025
cfa161b
fix numpy
bnpaws Sep 17, 2025
80bedbb
fix numpy 2
bnpaws Sep 17, 2025
e41822c
fix opencv
bnpaws Sep 17, 2025
43d6f72
remove numpy
bnpaws Sep 17, 2025
c27e777
adding cve-79595 to allowlist
bnpaws Sep 17, 2025
4f2333a
revert dlc file
bnpaws Sep 17, 2025
c32dbbf
Update ['dlc_developer_config.toml']
bnpaws Sep 17, 2025
e4db5c5
removing py scan allowlist
bnpaws Sep 17, 2025
bab0653
allowlist cve 79596
bnpaws Sep 17, 2025
36db1f6
Merge branch 'master' into libxml_pytorch_inf
bnpaws Sep 17, 2025
5b75ca5
revert dlc file
bnpaws Sep 17, 2025
0089547
Merge branch 'master' into libxml_pytorch_inf
bnpaws Sep 17, 2025
f2e82f8
Merge branch 'master' into libxml_pytorch_inf
bnpaws Sep 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion data/ignore_ids_safety_scan.json
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,16 @@
"71601": "Transformers version upgrade needs to be handled in a separate image",
"71670": "Pytorch version upgrade needs to be handled in a separate image",
"71671": "Pytorch version upgrade needs to be handled in a separate image",
"71672": "Pytorch version upgrade needs to be handled in a separate image"
"71672": "Pytorch version upgrade needs to be handled in a separate image",
"77740": "Affected versions of this package are vulnerable to a potential Denial of Service (DoS) attack due to unbounded recursion when parsing untrusted Protocol Buffers data. The pure-Python implementation fails to enforce recursion depth limits when processing recursive groups, recursive messages, or a series of SGROUP tags, leading to stack overflow conditions that can crash the application by exceeding Python's recursion limit.",
"78828": "Affected versions of the PyTorch package are vulnerable to Denial of Service (DoS) due to improper handling in the MKLDNN pooling implementation. The torch.mkldnn_max_pool2d function fails to properly validate input parameters, allowing crafted inputs to trigger resource exhaustion or crashes in the underlying MKLDNN library. An attacker with local access can exploit this vulnerability by passing specially crafted tensor dimensions or parameters to the max pooling function, causing the application to become unresponsive or crash.",
"78153": "A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically within the DonutProcessor class's token2json() method. This vulnerability affects versions 4.51.3 and earlier, and is fixed in version 4.52.1. The issue arises from the regex pattern <s_(.*?)> which can be exploited to cause excessive CPU consumption through crafted input strings due to catastrophic backtracking. This vulnerability can lead to service disruption, resource exhaustion, and potential API service vulnerabilities, impacting document processing tasks using the Donut model.",
"77986": "Hugging Face Transformers versions up to 4.49.0 are affected by an improper input validation vulnerability in the image_utils.py file. The vulnerability arises from insecure URL validation using the startswith() method, which can be bypassed through URL username injection. This allows attackers to craft URLs that appear to be from YouTube but resolve to malicious domains, potentially leading to phishing attacks, malware distribution, or data exfiltration. The issue is fixed in version 4.52.1.",
"78688": "Affected versions of the Hugging Face Transformers package are vulnerable to Regular Expression Denial of Service (ReDoS) due to an inefficient regex pattern in weight name conversion. The convert_tf_weight_name_to_pt_weight_name() function uses the regular expression pattern /[^/]___([^/])/, which is susceptible to catastrophic backtracking when processing specially crafted TensorFlow weight names. An attacker can exploit this vulnerability by providing malicious weight names during model conversion between TensorFlow and PyTorch formats, causing excessive CPU consumption and potentially rendering the service unresponsive.",
"77744": "urllib3 is a user-friendly HTTP client library for Python. Prior to 2.5.0, it is possible to disable redirects for all requests by instantiating a PoolManager and specifying retries in a way that disable redirects. By default, requests and botocore users are not affected. An application attempting to mitigate SSRF or open redirect vulnerabilities by disabling redirects at the PoolManager level will remain vulnerable. This issue has been patched in version 2.5.0.",
"79077": "Affected versions of the h2 package are vulnerable to HTTP Request Smuggling due to improper validation of illegal characters in HTTP headers. The package allows CRLF characters to be injected into header names and values without proper sanitisation, which can cause request boundary manipulation when HTTP/2 requests are downgraded to HTTP/1.1 by downstream servers.",
"79595": "Affected versions of the transformers package are vulnerable to Regular Expression Denial of Service (ReDoS) due to inefficient regular expressions in the EnglishNormalizer.normalize_numbers() method",
"79596": "Affected versions of the transformers package are vulnerable to Regular Expression Denial of Service (ReDoS) due to inefficient regular expressions in the MarianTokenizer.remove_language_code() method"
}
},
"inference-neuron": {
Expand Down
9 changes: 5 additions & 4 deletions huggingface/pytorch/inference/docker/2.6/py3/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ RUN pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pytho

# Install Common python packages
RUN pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -U \
opencv-python \
"opencv-python==4.11.0.86" \
"pyopenssl>=24.0.0" \
"cryptography>=42.0.5" \
"ipython>=8.10.0,<9.0" \
Expand Down Expand Up @@ -231,7 +231,8 @@ ENV HF_HUB_USER_AGENT_ORIGIN="aws:sagemaker:cpu:inference:regular"

# IPEx installation installs the numpy==1.25.1. That causes a pip check failure due to incompatibility with numba.
# Re-installing numpy after IPEx installation to get the appropriate numpy version and fix pip checks.
# RUN pip install --no-cache-dir \
RUN pip install --no-cache-dir \
"opencv-python==4.11.0.86"
# "numpy<1.25" \
# "pyyaml>=5.4"

Expand All @@ -244,7 +245,7 @@ RUN HOME_DIR=/root \
&& ${HOME_DIR}/oss_compliance/generate_oss_compliance.sh ${HOME_DIR} ${PYTHON} \
&& rm -rf ${HOME_DIR}/oss_compliance*

RUN curl -o /license.txt https://aws-dlc-licenses.s3.amazonaws.com/pytorch-2.3/license.txt
RUN curl -o /license.txt https://aws-dlc-licenses.s3.amazonaws.com/pytorch-2.6/license.txt

## Cleanup ##
RUN pip cache purge \
Expand All @@ -255,4 +256,4 @@ RUN pip cache purge \

EXPOSE 8080 8081
ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"]
CMD ["serve"]
CMD ["serve"]
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ RUN apt-get update \
tk-dev \
libffi-dev \
ffmpeg \
libxml2 \
linux-libc-dev \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
Expand Down Expand Up @@ -162,8 +164,6 @@ RUN /opt/conda/bin/conda install -y -c conda-forge \
"mkl<2024.1.0" \
mkl-include \
parso \
scipy \
numpy \
pandas \
pyarrow \
typing \
Expand All @@ -190,7 +190,8 @@ RUN pip install --upgrade pip --no-cache-dir --trusted-host pypi.org --trusted-h

# Install Common python packages
RUN pip install --no-cache-dir -U \
opencv-python \
"opencv-python==4.11.0.86" \
scipy \
# "nvgpu" is a dependency of TS but is disabled in SM DLC build,
# via ENV Variable "TS_DISABLE_SYSTEM_METRICS=true" in the SM section of this file.
# due to incompatibility with SM hosts
Expand Down Expand Up @@ -265,7 +266,8 @@ RUN pip install --no-cache-dir \
diffusers==${DIFFUSERS_VERSION} \
peft==${PEFT_VERSION} \
accelerate==${ACCELERATE_VERSION} \
sagemaker-huggingface-inference-toolkit==${SAGEMAKER_HF_INFERENCE_VERSION}
sagemaker-huggingface-inference-toolkit==${SAGEMAKER_HF_INFERENCE_VERSION} \
"opencv-python==4.11.0.86"

# hf_transfer will be a built-in feature, remove the env variavle then
ENV HF_HUB_ENABLE_HF_TRANSFER="1"
Expand All @@ -280,7 +282,7 @@ RUN HOME_DIR=/root \
&& ${HOME_DIR}/oss_compliance/generate_oss_compliance.sh ${HOME_DIR} ${PYTHON} \
&& rm -rf ${HOME_DIR}/oss_compliance*

RUN curl -o /license.txt https://aws-dlc-licenses.s3.amazonaws.com/pytorch-2.3/license.txt
RUN curl -o /license.txt https://aws-dlc-licenses.s3.amazonaws.com/pytorch-2.6/license.txt

## Cleanup ##
RUN pip cache purge \
Expand All @@ -289,4 +291,4 @@ RUN pip cache purge \

EXPOSE 8080 8081
ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"]
CMD ["serve"]
CMD ["serve"]