Skip to content

Commit 2eaa90a

Browse files
trivialfisCopilothcho3
authored
Security disclosure. (#12113)
--------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
1 parent c8a0998 commit 2eaa90a

4 files changed

Lines changed: 61 additions & 20 deletions

File tree

SECURITY.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
11
# Security Policy
22

3-
## Supported Versions
4-
5-
<!-- Use this section to tell people about which versions of your project are
6-
currently being supported with security updates. -->
7-
Security updates are applied only to the most recent release.
8-
9-
## Reporting a Vulnerability
10-
11-
<!-- Use this section to tell people how to report a vulnerability.
12-
13-
Tell them where to go, how often they can expect to get an update on a
14-
reported vulnerability, what to expect if the vulnerability is accepted or
15-
declined, etc. -->
16-
17-
To report a security issue, please email
18-
[security@xgboost-ci.net](mailto:security@xgboost-ci.net)
19-
with a description of the issue, the steps you took to create the issue,
20-
affected versions, and, if known, mitigations for the issue.
21-
22-
All support will be made on the best effort base, so please indicate the "urgency level" of the vulnerability as Critical, High, Medium or Low.
3+
See https://xgboost.readthedocs.build/en/latest/security.html for the current security policy.

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ Contents
3232
Julia Package <julia>
3333
C Package <c>
3434
C++ Interface <c++>
35+
security
3536
contrib/index
3637
changes/index

doc/security.rst

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
###################
2+
Security disclosure
3+
###################
4+
5+
********************
6+
Use of Python pickle
7+
********************
8+
9+
We use ``pickle`` and ``cloudpickle`` in several places, including a convenient helper function for the ``broadcast`` collective operation to share a Python object. The ``broadcast`` method is not used internally during training but is here to assist with implementing custom metrics. Also, a distributed interface like PySpark might use pickle to transfer Python objects, like the callback functions. Many security scanners will point out the use of pickle as unsafe.
10+
11+
XGBoost as a machine learning library is not designed to protect against pickle data from an untrusted source. Please use appropriate protection mechanisms to ensure that no one can control your network environment and tamper with the pickle data sent between XGBoost workers or the Spark executors. For example, cloud vendors provide managed solutions for running XGBoost in isolated network environments. As for all Python pickles in general, read the warning in the `pickle document <https://docs.python.org/3/library/pickle.html>`__.
12+
13+
Suggestion:
14+
15+
* Do not load pickle files from an unknown source.
16+
* Use secured network for distributed training.
17+
18+
***********************************************************
19+
The lack of authentication in the collective implementation
20+
***********************************************************
21+
22+
XGBoost uses TCP sockets for communication between workers during distributed model training. XGBoost is a numeric computation library; the collective module in intended for high-performance numeric operations (allreduce, allgather, etc.). For performance reasons, we decided that the collective module will NOT support TLS authentication or encryption.
23+
24+
Suggestion:
25+
26+
* Use secured network for distributed training.
27+
28+
***************************************************
29+
The lack of sanitizing for inputs, including models
30+
***************************************************
31+
32+
If someone can manipulate XGBoost inputs, whether with an incorrect model or an altered numpy array, XGBoost will crash due to a memory read error (out-of-bounds access). The reports we received describe manipulating the JSON files to mislead XGBoost into reading out-of-bounds values or using conflicting tree indices. We acknowledge that we can add stronger sanitization to the JSON parser when loading from a file. However, it is currently impractical for us to comprehensively validate all potential issues in a supplied model file. Instead, deployments are expected to rely on standard operating-system–level protections. Examples of non-sanitized inputs:
33+
34+
- Manipulated leaf index in a tree model.
35+
- Manipulated length in a UBJSON model.
36+
37+
Suggestions:
38+
39+
* For most users, this should not cause a security issue. Your Python program might crash when loading a manipulated JSON model file.
40+
* Test the model in an isolated environment before loading it in a critical environment.
41+
42+
***************
43+
Security Policy
44+
***************
45+
46+
==================
47+
Supported Versions
48+
==================
49+
50+
Only the latest XGBoost release is supported.
51+
52+
=========================
53+
Reporting a Vulnerability
54+
=========================
55+
56+
To report a security issue, please email security@xgboost-ci.net with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue.
57+
58+
All support will be made on the best effort base, so please indicate the "urgency level" of the vulnerability as Critical, High, Medium or Low.

src/gbm/gbtree_model.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ void GBTreeModel::LoadModel(Json const& in) {
9797

9898
common::ParallelFor(param.num_trees, ctx_->Threads(), [&](auto t) {
9999
auto tree_id = get<Integer const>(trees_json[t]["id"]);
100+
CHECK_EQ(tree_id, t);
100101
trees.at(tree_id).reset(new RegTree{});
101102
trees[tree_id]->LoadModel(trees_json[t]);
102103
});

0 commit comments

Comments
 (0)