From 3f13902f85847e95995b273998f013c848706b96 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Tue, 8 Sep 2026 10:53:00 +0200 Subject: [PATCH 1/4] Checks srcVariableName and dstVariableName in copy_to_global_request --- src/xdebugger.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/xdebugger.cpp b/src/xdebugger.cpp index 9bbe8f1c..c123eb3a 100644 --- a/src/xdebugger.cpp +++ b/src/xdebugger.cpp @@ -212,9 +212,30 @@ namespace xpyt std::string src_var_name = message["arguments"]["srcVariableName"].get(); std::string dst_var_name = message["arguments"]["dstVariableName"].get(); - int src_frame_id = message["arguments"]["srcFrameId"].get(); + bool valid = false; + { + py::gil_scoped_acquire acquire; + py::str py_src_var_name = py::str(src_var_name); + py::str py_dst_var_name = py::str(dst_var_name); + bool valid_src_name = PyUnicode_IsIdentifier(py_src_var_name.ptr()) == 1; + bool valid_dst_name = PyUnicode_IsIdentifier(py_dst_var_name.ptr()) == 1; + valid = valid_src_name && valid_dst_name; + } + + if (!valid) + { + nl::json reply = { + {"type", "response"}, + {"request_seq", message["seq"]}, + {"success", false}, + {"command", message["command"]}, + {"message", "dstVariableName and srcVariableName must be valid identifiers"} + }; + return reply; + } // It basically runs a setExpression in the globals dictionary of Python. + int src_frame_id = message["arguments"]["srcFrameId"].get(); int seq = message["seq"].get(); std::string expression = "globals()['" + dst_var_name + "']"; nl::json request = { From f7d69e733cc9820ee755231ab8e77058f2c2c90e Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Tue, 8 Sep 2026 11:47:56 +0200 Subject: [PATCH 2/4] Fixed CI to be compatible with cxx-compilers >= 2 --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93d8a53a..764fa90b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,8 +57,6 @@ jobs: -D CMAKE_INSTALL_LIBDIR=lib \ -D PYTHON_EXECUTABLE=`which python` \ -D XPYT_BUILD_TESTS=ON \ - -D CMAKE_C_COMPILER=$CC \ - -D CMAKE_CXX_COMPILER=$CXX \ ${{ env.CMAKE_EXTRA_ARGS }} working-directory: build From 428b49a7ea9365458ded94c4a09d2199f2ab9086 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Tue, 8 Sep 2026 11:56:59 +0200 Subject: [PATCH 3/4] Upgraded to latest xeus-python-shell --- environment-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment-dev.yml b/environment-dev.yml index eb273d25..f3925418 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -16,7 +16,7 @@ dependencies: # of a spurious bug in debugpy - python <3.13 - pip - - xeus-python-shell>=0.7.0,<0.8 + - xeus-python-shell>=0.8.0,<0.9 - debugpy>=1.6.5 - ipython # Test dependencies From 5280de92cf25af4ff6dc29e8ddd6cd975efb7ccf Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Tue, 8 Sep 2026 13:31:44 +0200 Subject: [PATCH 4/4] openSSL < 4 for wasm builds --- environment-wasm-host.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment-wasm-host.yml b/environment-wasm-host.yml index afdc4e0f..efd13000 100644 --- a/environment-wasm-host.yml +++ b/environment-wasm-host.yml @@ -15,7 +15,7 @@ dependencies: - pyjs >=4,<5 - libpython - zstd - - openssl + - openssl <4 - xz - ipywidgets - xeus-python-shell>=0.7.0,<0.8