Skip to content

Commit db89a8d

Browse files
committed
initial attempt to fix security vulnerability
Signed-off-by: DONNOT Benjamin <[email protected]>
1 parent 62a3653 commit db89a8d

File tree

10 files changed

+19
-1398
lines changed

10 files changed

+19
-1398
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ Native multi agents support:
124124
the functions `load_grid`, `reset`, `copy` and `apply_action` which were part of the public
125125
API. These last member functions will be renamed (in a later version) `_load_grid`,
126126
`_reset`, `_copy` and `_apply_action` to reflect this change. NOT for this version however !
127+
- [BREAKING] removal of the `rest_server` grid2op module (it will be release as a separate package instead)
128+
It has been removed from grid2op core package for securtiy reasons.
127129
- [FIXED] issue https://github.com/Grid2op/grid2op/issues/657
128130
- [FIXED] missing an import on the `MaskedEnvironment` class
129131
- [FIXED] a bug when trying to set the load_p, load_q, gen_p, gen_v by names.

docs/makeenv.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ a new algorithm of "Reinforcement Learning" and you used the openai gymnasium fr
3333
in a few minutes (basically this consists in adapting the input and output dimension of your BaseAgent) and make it work
3434
with a Grid2Op environment. An example of such modifications is exposed in the getting_started/ notebooks.
3535

36+
.. danger::
37+
The :func:`grid2op.make` function can execute arbitrary code. Do not attempt
38+
to "make" an environment for which you don't trust (or even know) the authors.
39+
3640
.. _usage:
3741

3842
Usage

grid2op/MakeEnv/Make.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,17 @@ def make(
314314
315315
.. versionadded:: 1.11.0
316316
The `allow_detachment` parameter
317+
318+
.. danger::
319+
The :func:`grid2op.make` function can execute arbitrary code. Do not attempt
320+
to "make" an environment for which you don't trust (or even know) the authors.
317321
318322
Parameters
319323
----------
320324
321325
dataset: ``str`` or path
322326
Name of the environment you want to create
323-
327+
324328
test: ``bool``
325329
Whether you want to use a test environment (**NOT** recommended). Use at your own risk.
326330

grid2op/MakeEnv/MakeFromPath.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ def make_from_dataset_path(
147147
Prefer using the :func:`grid2op.make` function.
148148
149149
150+
.. danger::
151+
The :func:`grid2op.make` function can execute arbitrary code. Do not attempt
152+
to "make" an environment for which you don't trust (or even know) the authors.
153+
154+
150155
This function is a shortcut to rapidly create environments within the grid2op Framework. We don't
151156
recommend using directly this function. Prefer using the :func:`make` function.
152157
@@ -920,13 +925,13 @@ def make_from_dataset_path(
920925
_add_to_name = '' # already defined in the first mix
921926
name_env = _overload_name_multimix.name_env
922927

923-
928+
name_env = name_env + _add_to_name
924929
default_kwargs = dict(
925930
init_env_path=os.path.abspath(dataset_path),
926931
init_grid_path=grid_path_abs,
927932
backend=backend,
928933
parameters=param,
929-
name=name_env + _add_to_name,
934+
name=name_env,
930935
names_chronics_to_backend=names_chronics_to_backend,
931936
actionClass=action_class,
932937
observationClass=observation_class,

grid2op/rest_server/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)