diff --git a/news/2849.bugfix.md b/news/2849.bugfix.md
new file mode 100644
index 00000000..3bef6128
--- /dev/null
+++ b/news/2849.bugfix.md
@@ -0,0 +1,1 @@
+Fix env and other options being inherited in nested composite scripts.
\ No newline at end of file
diff --git a/src/pdm/cli/commands/run.py b/src/pdm/cli/commands/run.py
index 69f64f24..06d0891e 100644
--- a/src/pdm/cli/commands/run.py
+++ b/src/pdm/cli/commands/run.py
@@ -277,6 +277,8 @@ class TaskRunner:
             should_interpolate = should_interpolate or any(RE_PDM_PLACEHOLDER.search(script) for script in value)
             composite_code = 0
             keep_going = options.pop("keep_going", False) if options else False
+            if opts:
+                cast(dict, options).update(**exec_opts(options, opts))
             for script in value:
                 if should_interpolate:
                     script, _ = interpolate(script, args)

diff --git a/tests/cli/test_run.py b/tests/cli/test_run.py
index e97e5c0f..4b4e4af5 100644
--- a/tests/cli/test_run.py
+++ b/tests/cli/test_run.py
@@ -640,7 +640,15 @@ def test_composite_inherit_env(project, pdm, capfd, _echo):
             "cmd": "python echo.py Second VAR",
             "env": {"VAR": "42"},
         },
-        "test": {"composite": ["first", "second"], "env": {"VAR": "overriden"}},
+        "nested": {
+            "composite": ["third"],
+            "env": {"VAR": "42"},
+        },
+        "third": {
+            "cmd": "python echo.py Third VAR",
+            "env": {"VAR": "42"},
+        },
+        "test": {"composite": ["first", "second", "nested"], "env": {"VAR": "overriden"}},
     }
     project.pyproject.write()
     capfd.readouterr()
@@ -648,6 +656,7 @@ def test_composite_inherit_env(project, pdm, capfd, _echo):
     out, _ = capfd.readouterr()
     assert "First CALLED with VAR=overriden" in out
     assert "Second CALLED with VAR=overriden" in out
+    assert "Third CALLED with VAR=overriden" in out
 
 
 def test_composite_fail_on_first_missing_task(project, pdm, capfd, _echo):

ENV is not inherited in nested composite scripts
- [x] I have searched the issue tracker and believe that this is not a duplicate.

Environment variables are inherited from composite scripts to regular commands, but not between nested composite scripts.

## Steps to reproduce

<!--Describe the minimized example of how to reproduce the bug-->

- Create three scripts:
  - `test` composite, which calls ...
  - `nested` composite, which calls ...
  - `foo` script
- Scripts `test` and `foo` define different values for `env.VAR`
  - optional: `nested` also defines a value for `env.VAR`
- Call the `test` script: `pdm run -v test`

```toml
[tool.pdm.scripts]
test.composite = ["nested"]
test.env.VAR = "test"
nested.composite = ["foo"]
# nested.env.VAR = "nested"
foo.cmd = "python -c \"print('${VAR}')\""
foo.env.VAR = "bar"
```

## Actual behavior

<!--A clear and concise description the result of the above steps-->

Running `test` when `env.VAR` is not overridden in `nested`:
```shell
Running <task test>: []
Running <task nested>: []
Running <task foo>: ['python', '-c', "print('${VAR}')"]
bar
```
In this case, `VAR` gets the original value defined in `foo`.

Running `test` after uncommenting `nested.env.VAR = "nested"`:
```shell
Running <task test>: []
Running <task nested>: []
Running <task foo>: ['python', '-c', "print('${VAR}')"]
nested
```
Now, we see the overridden value defined in `nested`.

## Expected behavior

<!--A clear and concise description of what you expected to happen.-->
In both cases, I would expect `VAR` to be `test`, as defined in the `test` script.

## Environment Information

```bash
PDM version:
  2.15.0
Python Interpreter:
  redacted/.venv/bin/python (3.12)
Project Root:
  redacted
Local Packages:
  
{
  "implementation_name": "cpython",
  "implementation_version": "3.12.0",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.15.133.1-microsoft-standard-WSL2",
  "platform_system": "Linux",
  "platform_version": "#1 SMP Thu Oct 5 21:02:42 UTC 2023",
  "python_full_version": "3.12.0",
  "platform_python_implementation": "CPython",
  "python_version": "3.12",
  "sys_platform": "linux"
}
```
tests/cli/test_run.py::test_composite_inherit_env
tests/cli/test_run.py::test_auto_isolate_site_packages tests/cli/test_run.py::test_run_with_site_packages tests/cli/test_run.py::test_run_command_not_found tests/cli/test_run.py::test_run_pass_exit_code tests/cli/test_run.py::test_run_cmd_script tests/cli/test_run.py::test_run_cmd_script_with_array tests/cli/test_run.py::test_run_script_pass_project_root tests/cli/test_run.py::test_run_shell_script tests/cli/test_run.py::test_run_script_with_relative_path tests/cli/test_run.py::test_run_non_existing_local_script tests/cli/test_run.py::test_run_shell_script_with_args_placeholder[with-args] tests/cli/test_run.py::test_run_shell_script_with_args_placeholder[without-args] tests/cli/test_run.py::test_run_shell_script_with_args_placeholder_with_default[with-args] tests/cli/test_run.py::test_run_shell_script_with_args_placeholder_with_default[with-default] tests/cli/test_run.py::test_run_call_script tests/cli/test_run.py::test_run_script_with_extra_args tests/cli/test_run.py::test_run_script_with_args_placeholder[as-str-with-args] tests/cli/test_run.py::test_run_script_with_args_placeholder[as-str-without-args] tests/cli/test_run.py::test_run_script_with_args_placeholder[as-list-with-args] tests/cli/test_run.py::test_run_script_with_args_placeholder[as-list-without-args] tests/cli/test_run.py::test_run_script_with_args_placeholder_with_default[as-str-with-args] tests/cli/test_run.py::test_run_script_with_args_placeholder_with_default[as-str-default] tests/cli/test_run.py::test_run_script_with_args_placeholder_with_default[as-list-with-args] tests/cli/test_run.py::test_run_script_with_args_placeholder_with_default[as-list-default] tests/cli/test_run.py::test_run_shell_script_with_pdm_placeholder tests/cli/test_run.py::test_run_expand_env_vars tests/cli/test_run.py::test_run_expand_env_vars_from_config tests/cli/test_run.py::test_run_script_with_env_defined tests/cli/test_run.py::test_run_script_with_dotenv_file tests/cli/test_run.py::test_run_script_override_global_env tests/cli/test_run.py::test_run_show_list_of_scripts tests/cli/test_run.py::test_run_show_list_of_scripts_hide_internals tests/cli/test_run.py::test_run_json_list_of_scripts tests/cli/test_run.py::test_import_another_sitecustomize tests/cli/test_run.py::test_run_with_patched_sysconfig tests/cli/test_run.py::test_run_composite tests/cli/test_run.py::test_composite_stops_on_first_failure tests/cli/test_run.py::test_composite_keep_going_on_failure tests/cli/test_run.py::test_composite_fail_on_first_missing_task tests/cli/test_run.py::test_composite_fails_on_recursive_script tests/cli/test_run.py::test_composite_runs_all_hooks tests/cli/test_run.py::test_composite_pass_parameters_to_subtasks tests/cli/test_run.py::test_composite_can_pass_parameters tests/cli/test_run.py::test_composite_only_pass_parameters_to_subtasks_with_args[with-args] tests/cli/test_run.py::test_composite_only_pass_parameters_to_subtasks_with_args[without-args] tests/cli/test_run.py::test_composite_only_pass_parameters_to_subtasks_with_args_with_default[with-args] tests/cli/test_run.py::test_composite_only_pass_parameters_to_subtasks_with_args_with_default[default] tests/cli/test_run.py::test_composite_hooks_inherit_env tests/cli/test_run.py::test_composite_inherit_env_in_cascade tests/cli/test_run.py::test_composite_inherit_dotfile tests/cli/test_run.py::test_composite_can_have_commands tests/cli/test_run.py::test_run_shortcut tests/cli/test_run.py::test_run_shortcuts_dont_override_commands tests/cli/test_run.py::test_run_shortcut_fail_with_usage_if_script_not_found tests/cli/test_run.py::test_empty_positionnal_args_still_display_usage[unknown tests/cli/test_run.py::test_empty_positionnal_args_still_display_usage[not tests/cli/test_run.py::test_empty_positional_args_display_help tests/cli/test_run.py::test_run_script_changing_working_dir