CVE-2023-34237: Insufficient Information (NVD-CWE-noinfo)
value: SABnzbd is an open source automated Usenet download tool. A design flaw was discovered in SABnzbd that could allow remote code execution. Manipulating the Parameters setting in the Notification Script functionality allows code execution with the privileges of the SABnzbd process. Exploiting the vulnerabilities requires access to the web interface. Remote exploitation is possible if users[exposed their setup to the internet or other untrusted networks without setting a username/password. By default SABnzbd is only accessible from `localhost`, with no authentication required for the web interface. This issue has been patched in commits `e3a722` and `422b4f` which have been included in the 4.0.2 release. Users are advised to upgrade. Users unable to upgrade should ensure that a username and password have been set if their instance is web accessible.
CWE description: There is insufficient information about the issue to classify it; details are unkown or unspecified.
CVSS v3 base score: 9.8
Published: 2023-06-07T20:15Z
Repository: https://github.com/sabnzbd/sabnzbd
Language: Python
Files changed: sabnzbd/notifier.py
Commit date: 2023-05-31 11:35:23 +0200
Commit message: Move Notification Script Parameters to environment variable

Fixes #2549
Diff: diff --git a/sabnzbd/notifier.py b/sabnzbd/notifier.py
index c8a877708..455c71332 100644
--- a/sabnzbd/notifier.py
+++ b/sabnzbd/notifier.py
@@ -348,26 +348,26 @@ def send_pushbullet(title, msg, gtype, force=False, test=None):
 
 def send_nscript(title, msg, gtype, force=False, test=None):
     """Run user's notification script"""
     if test:
         script = test.get("nscript_script")
-        nscript_parameters = test.get("nscript_parameters")
+        env = {"notification_parameters": test.get("nscript_parameters")}
     else:
         script = sabnzbd.cfg.nscript_script()
-        nscript_parameters = sabnzbd.cfg.nscript_parameters()
-    nscript_parameters = nscript_parameters.split()
+        env = {"notification_parameters": sabnzbd.cfg.nscript_parameters()}
+
     if not script:
         return T("Cannot send, missing required data")
     title = "SABnzbd: " + T(NOTIFICATION.get(gtype, "other"))
 
     if force or check_classes(gtype, "nscript"):
         script_path = make_script_path(script)
         if script_path:
             ret = -1
             output = None
             try:
-                p = build_and_run_command([script_path, gtype, title, msg] + nscript_parameters, env=create_env())
+                p = build_and_run_command([script_path, gtype, title, msg], env=create_env(extra_env_fields=env))
                 output = p.stdout.read()
                 ret = p.wait()
             except:
                 logging.info("Failed script %s, Traceback: ", script, exc_info=True)
 

Vulnerable code:         nscript_parameters = test.get("nscript_parameters")
        nscript_parameters = sabnzbd.cfg.nscript_parameters()
    nscript_parameters = nscript_parameters.split()
                p = build_and_run_command([script_path, gtype, title, msg] + nscript_parameters, env=create_env())
Fixed code:         env = {"notification_parameters": test.get("nscript_parameters")}
        env = {"notification_parameters": sabnzbd.cfg.nscript_parameters()}

                p = build_and_run_command([script_path, gtype, title, msg], env=create_env(extra_env_fields=env))