{
    "document": {
        "category": "csaf_base",
        "csaf_version": "2.0",
        "distribution": {
            "tlp": {
                "label": "WHITE"
            }
        },
        "lang": "en",
        "notes": [
            {
                "category": "legal_disclaimer",
                "text": "The Netherlands Cyber Security Center (henceforth: NCSC-NL) maintains this portal to enhance access to its information and vulnerabilities. The use of this information is subject to the following terms and conditions:\n\nThe vulnerabilities disclosed in this portal are gathered by NCSC-NL from a variety of open sources, which the user can retrieve from other platforms. NCSC-NL makes every reasonable effort to ensure that the content of this portal is kept up to date, and that it is accurate and complete. Nevertheless, NCSC-NL cannot entirely rule out the possibility of errors, and therefore cannot give any warranty in respect of its completeness, accuracy or real-time keeping up-to-date. NCSC-NL does not control nor guarantee the accuracy, relevance, timeliness or completeness of information obtained from these external sources. The vulnerabilities disclosed in this portal are intended solely for the convenience of professional parties to take appropriate measures to manage the risks posed to the cybersecurity. No rights can be derived from the information provided therein.\n\nNCSC-NL and the Kingdom of the Netherlands assume no legal liability or responsibility for any damage resulting from either the use or inability of use of the vulnerabilities disclosed in this portal. This includes damage resulting from the inaccuracy of incompleteness of the information contained in it.\nThe information on this page is subject to Dutch law. All disputes related to or arising from the use of this portal regarding the disclosure of vulnerabilities will be submitted to the competent court in The Hague. This choice of means also applies to the court in summary proceedings."
            }
        ],
        "publisher": {
            "category": "coordinator",
            "contact_details": "cert@ncsc.nl",
            "name": "National Cyber Security Centre",
            "namespace": "https://www.ncsc.nl/"
        },
        "title": "CVE-2026-33718",
        "tracking": {
            "current_release_date": "2026-03-28T07:57:26.946104Z",
            "generator": {
                "date": "2026-02-17T15:00:00Z",
                "engine": {
                    "name": "V.E.L.M.A",
                    "version": "1.7"
                }
            },
            "id": "CVE-2026-33718",
            "initial_release_date": "2026-03-25T23:16:45.531019Z",
            "revision_history": [
                {
                    "date": "2026-03-25T23:16:45.531019Z",
                    "number": "1",
                    "summary": "CVE created.| Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (6).| CWES updated (1)."
                },
                {
                    "date": "2026-03-25T23:16:47.868945Z",
                    "number": "2",
                    "summary": "NCSC Score created."
                },
                {
                    "date": "2026-03-26T00:37:36.785611Z",
                    "number": "3",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| Products created (15).| Product Identifiers created (14).| References created (5).| CWES updated (1)."
                },
                {
                    "date": "2026-03-26T00:37:49.354111Z",
                    "number": "4",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-27T00:38:39.608201Z",
                    "number": "5",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| Products created (1).| References created (5).| CWES updated (1)."
                },
                {
                    "date": "2026-03-27T00:38:47.287717Z",
                    "number": "6",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-27T01:24:55.712478Z",
                    "number": "7",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (5).| CWES updated (1)."
                },
                {
                    "date": "2026-03-27T01:25:06.071305Z",
                    "number": "8",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-27T07:35:12.521741Z",
                    "number": "9",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-27T20:56:24.697088Z",
                    "number": "10",
                    "summary": "Source connected.| CVE status created. (valid)| EPSS created."
                },
                {
                    "date": "2026-03-27T20:56:26.856571Z",
                    "number": "11",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-27T21:26:25.974755Z",
                    "number": "12",
                    "summary": "Unknown change."
                },
                {
                    "date": "2026-03-28T07:57:23.312689Z",
                    "number": "13",
                    "summary": "References created (1)."
                }
            ],
            "status": "interim",
            "version": "13"
        }
    },
    "product_tree": {
        "branches": [
            {
                "branches": [
                    {
                        "branches": [
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/<1.5.0",
                                "product": {
                                    "name": "vers:unknown/<1.5.0",
                                    "product_id": "CSAFPID-5920662"
                                }
                            }
                        ],
                        "category": "product_name",
                        "name": "OpenHands"
                    },
                    {
                        "branches": [
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/0.0.0",
                                "product": {
                                    "name": "vers:unknown/0.0.0",
                                    "product_id": "CSAFPID-5912815",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@0.0.0"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.0.0",
                                "product": {
                                    "name": "vers:unknown/1.0.0",
                                    "product_id": "CSAFPID-5912816",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.0.0"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.0.1",
                                "product": {
                                    "name": "vers:unknown/1.0.1",
                                    "product_id": "CSAFPID-5912817",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.0.1"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.0.2",
                                "product": {
                                    "name": "vers:unknown/1.0.2",
                                    "product_id": "CSAFPID-5912818",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.0.2"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.0.3",
                                "product": {
                                    "name": "vers:unknown/1.0.3",
                                    "product_id": "CSAFPID-5912819",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.0.3"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.0.4",
                                "product": {
                                    "name": "vers:unknown/1.0.4",
                                    "product_id": "CSAFPID-5912820",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.0.4"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.0.5",
                                "product": {
                                    "name": "vers:unknown/1.0.5",
                                    "product_id": "CSAFPID-5912821",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.0.5"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.0.6",
                                "product": {
                                    "name": "vers:unknown/1.0.6",
                                    "product_id": "CSAFPID-5912822",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.0.6"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.0.7",
                                "product": {
                                    "name": "vers:unknown/1.0.7",
                                    "product_id": "CSAFPID-5912823",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.0.7"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.2.0",
                                "product": {
                                    "name": "vers:unknown/1.2.0",
                                    "product_id": "CSAFPID-5912824",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.2.0"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.2.1",
                                "product": {
                                    "name": "vers:unknown/1.2.1",
                                    "product_id": "CSAFPID-5912825",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.2.1"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.3.0",
                                "product": {
                                    "name": "vers:unknown/1.3.0",
                                    "product_id": "CSAFPID-5912826",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.3.0"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.4.0",
                                "product": {
                                    "name": "vers:unknown/1.4.0",
                                    "product_id": "CSAFPID-5912827",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.4.0"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/1.4.1",
                                "product": {
                                    "name": "vers:unknown/1.4.1",
                                    "product_id": "CSAFPID-5912828",
                                    "product_identification_helper": {
                                        "purl": "pkg:pypi/openhands@1.4.1"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/>=0|<1.5.0",
                                "product": {
                                    "name": "vers:unknown/>=0|<1.5.0",
                                    "product_id": "CSAFPID-5912829"
                                }
                            }
                        ],
                        "category": "product_name",
                        "name": "openhands"
                    }
                ],
                "category": "vendor",
                "name": "OpenHands"
            }
        ]
    },
    "vulnerabilities": [
        {
            "cve": "CVE-2026-33718",
            "cwe": {
                "id": "CWE-78",
                "name": "Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"
            },
            "notes": [
                {
                    "category": "description",
                    "text": "## Summary\n\nA Command Injection vulnerability exists in the `get_git_diff()` method at `openhands/runtime/utils/git_handler.py:134`. The `path` parameter from the `/api/conversations/{conversation_id}/git/diff` API endpoint is passed unsanitized to a shell command, allowing authenticated attackers to execute arbitrary commands in the agent sandbox. The user is already allowed to instruct the agent to execute commands, but this bypasses the normal channels.\n\n---\n\n## Details\n\n### Vulnerable Code Path\n\nThe vulnerability flows through these files:\n\n1. **API Endpoint** (`openhands/server/routes/files.py:267-277`)\n```python\n@app.get('/git/diff')\nasync def git_diff(\n    path: str,  # <-- User input from HTTP request\n    ...\n):\n    ...\n    diff = await call_sync_from_async(runtime.get_git_diff, path, cwd)  # No sanitization\n```\n\n2. **Runtime** (`openhands/runtime/base.py:1231-1233`)\n```python\ndef get_git_diff(self, file_path: str, cwd: str) -> dict[str, str]:\n    self.git_handler.set_cwd(cwd)\n    return self.git_handler.get_git_diff(file_path)  # Passed directly\n```\n\n3. **Vulnerable Method** (`openhands/runtime/utils/git_handler.py:10-12, 134`)\n```python\n# Command template with placeholder\nGIT_DIFF_CMD = 'python3 /openhands/code/openhands/runtime/utils/git_diff.py \"{file_path}\"'\n\n# Line 134 - VULNERABLE: User input directly interpolated\nresult = self.execute(self.git_diff_cmd.format(file_path=file_path), self.cwd)\n```\n\n4. **Shell Execution** (`openhands/runtime/utils/git_diff.py:25-27`)\n```python\ndef run(cmd: str, cwd: str) -> str:\n    result = subprocess.run(\n        args=cmd,\n        shell=True,  # <-- Enables shell metacharacter interpretation\n        stdout=subprocess.PIPE,\n        stderr=subprocess.PIPE,\n        cwd=cwd\n    )\n```\n\n### Root Cause\n\nThe `file_path` parameter is directly interpolated into a shell command string using Python's `.format()` method without any sanitization. When this command is executed with `shell=True`, shell metacharacters like `\"`, `;`, and `#` are interpreted, allowing command injection.\n\n**Example:**\n- Input: `test\"; id #`\n- Constructed command: `python3 /script.py \"test\"; id #\"`\n- Shell interprets as two commands: `python3 /script.py \"test\"` AND `id`\n\n---\n\n## Impact\n\n### Who is Affected\n- All OpenHands deployments exposing the `/api/conversations/{id}/git/diff` endpoint\n- Any authenticated user can exploit this vulnerability, \n\n### Attack Capabilities\nAn attacker can:\n1. **Execute arbitrary commands** on the runtime container as root\n2. **Read sensitive files** including `.env`, API keys, source code\n3. **Write arbitrary files** to inject malicious code\n4. **Establish reverse shells** for persistent access\n5. **Potentially escape the container** if Docker is misconfigured\n\n## Mitigation \n\nUsers should update to the latest version of OpenHands that includes the changes from PR #13051. The fix replaces direct shell string formatting with proper argument array handling or rigorous path sanitization to prevent command chaining.",
                    "title": "github - https://api.github.com/advisories/GHSA-7h8w-hj9j-8rjw"
                },
                {
                    "category": "description",
                    "text": "## Summary\n\nA Command Injection vulnerability exists in the `get_git_diff()` method at `openhands/runtime/utils/git_handler.py:134`. The `path` parameter from the `/api/conversations/{conversation_id}/git/diff` API endpoint is passed unsanitized to a shell command, allowing authenticated attackers to execute arbitrary commands in the agent sandbox. The user is already allowed to instruct the agent to execute commands, but this bypasses the normal channels.\n\n---\n\n## Details\n\n### Vulnerable Code Path\n\nThe vulnerability flows through these files:\n\n1. **API Endpoint** (`openhands/server/routes/files.py:267-277`)\n```python\n@app.get('/git/diff')\nasync def git_diff(\n    path: str,  # <-- User input from HTTP request\n    ...\n):\n    ...\n    diff = await call_sync_from_async(runtime.get_git_diff, path, cwd)  # No sanitization\n```\n\n2. **Runtime** (`openhands/runtime/base.py:1231-1233`)\n```python\ndef get_git_diff(self, file_path: str, cwd: str) -> dict[str, str]:\n    self.git_handler.set_cwd(cwd)\n    return self.git_handler.get_git_diff(file_path)  # Passed directly\n```\n\n3. **Vulnerable Method** (`openhands/runtime/utils/git_handler.py:10-12, 134`)\n```python\n# Command template with placeholder\nGIT_DIFF_CMD = 'python3 /openhands/code/openhands/runtime/utils/git_diff.py \"{file_path}\"'\n\n# Line 134 - VULNERABLE: User input directly interpolated\nresult = self.execute(self.git_diff_cmd.format(file_path=file_path), self.cwd)\n```\n\n4. **Shell Execution** (`openhands/runtime/utils/git_diff.py:25-27`)\n```python\ndef run(cmd: str, cwd: str) -> str:\n    result = subprocess.run(\n        args=cmd,\n        shell=True,  # <-- Enables shell metacharacter interpretation\n        stdout=subprocess.PIPE,\n        stderr=subprocess.PIPE,\n        cwd=cwd\n    )\n```\n\n### Root Cause\n\nThe `file_path` parameter is directly interpolated into a shell command string using Python's `.format()` method without any sanitization. When this command is executed with `shell=True`, shell metacharacters like `\"`, `;`, and `#` are interpreted, allowing command injection.\n\n**Example:**\n- Input: `test\"; id #`\n- Constructed command: `python3 /script.py \"test\"; id #\"`\n- Shell interprets as two commands: `python3 /script.py \"test\"` AND `id`\n\n---\n\n## Impact\n\n### Who is Affected\n- All OpenHands deployments exposing the `/api/conversations/{id}/git/diff` endpoint\n- Any authenticated user can exploit this vulnerability, \n\n### Attack Capabilities\nAn attacker can:\n1. **Execute arbitrary commands** on the runtime container as root\n2. **Read sensitive files** including `.env`, API keys, source code\n3. **Write arbitrary files** to inject malicious code\n4. **Establish reverse shells** for persistent access\n5. **Potentially escape the container** if Docker is misconfigured\n\n## Mitigation \n\nUsers should update to the latest version of OpenHands that includes the changes from PR #13051. The fix replaces direct shell string formatting with proper argument array handling or rigorous path sanitization to prevent command chaining.",
                    "title": "osv - https://www.googleapis.com/download/storage/v1/b/osv-vulnerabilities/o/PyPI%2FGHSA-7h8w-hj9j-8rjw.json?alt=media"
                },
                {
                    "category": "description",
                    "text": "OpenHands is software for AI-driven development. Starting in version 1.5.0, a Command Injection vulnerability exists in the `get_git_diff()` method at `openhands/runtime/utils/git_handler.py:134`. The `path` parameter from the `/api/conversations/{conversation_id}/git/diff` API endpoint is passed unsanitized to a shell command, allowing authenticated attackers to execute arbitrary commands in the agent sandbox. The user is already allowed to instruct the agent to execute commands, but this bypasses the normal channels. Version 1.5.0 fixes the issue.",
                    "title": "cveprojectv5 - https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/33xxx/CVE-2026-33718.json"
                },
                {
                    "category": "description",
                    "text": "OpenHands is software for AI-driven development. Starting in version 1.5.0, a Command Injection vulnerability exists in the `get_git_diff()` method at `openhands/runtime/utils/git_handler.py:134`. The `path` parameter from the `/api/conversations/{conversation_id}/git/diff` API endpoint is passed unsanitized to a shell command, allowing authenticated attackers to execute arbitrary commands in the agent sandbox. The user is already allowed to instruct the agent to execute commands, but this bypasses the normal channels. Version 1.5.0 fixes the issue.",
                    "title": "nvd - https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-33718"
                },
                {
                    "category": "other",
                    "text": "0.00227",
                    "title": "EPSS"
                },
                {
                    "category": "other",
                    "text": "4.1",
                    "title": "NCSC Score"
                },
                {
                    "category": "other",
                    "text": "There is cwe data available from source Nvd",
                    "title": "NCSC Score top decreasing factors"
                }
            ],
            "product_status": {
                "known_affected": [
                    "CSAFPID-5912815",
                    "CSAFPID-5912816",
                    "CSAFPID-5912817",
                    "CSAFPID-5912818",
                    "CSAFPID-5912819",
                    "CSAFPID-5912820",
                    "CSAFPID-5912821",
                    "CSAFPID-5912822",
                    "CSAFPID-5912823",
                    "CSAFPID-5912824",
                    "CSAFPID-5912825",
                    "CSAFPID-5912826",
                    "CSAFPID-5912827",
                    "CSAFPID-5912828",
                    "CSAFPID-5912829",
                    "CSAFPID-5920662"
                ]
            },
            "references": [
                {
                    "category": "external",
                    "summary": "Source - github",
                    "url": "https://api.github.com/advisories/GHSA-7h8w-hj9j-8rjw"
                },
                {
                    "category": "external",
                    "summary": "Source - osv",
                    "url": "https://www.googleapis.com/download/storage/v1/b/osv-vulnerabilities/o/PyPI%2FGHSA-7h8w-hj9j-8rjw.json?alt=media"
                },
                {
                    "category": "external",
                    "summary": "Source - cveprojectv5",
                    "url": "https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/33xxx/CVE-2026-33718.json"
                },
                {
                    "category": "external",
                    "summary": "Source - nvd",
                    "url": "https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-33718"
                },
                {
                    "category": "external",
                    "summary": "Source - first",
                    "url": "https://api.first.org/data/v1/epss?limit=10000&offset=0"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd; osv",
                    "url": "https://github.com/OpenHands/OpenHands/security/advisories/GHSA-7h8w-hj9j-8rjw"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd; osv",
                    "url": "https://github.com/OpenHands/OpenHands/pull/13051"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd; osv",
                    "url": "https://docs.python.org/3/library/shlex.html#shlex.quote"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd; osv",
                    "url": "https://docs.python.org/3/library/subprocess.html#security-considerations"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd; osv",
                    "url": "https://owasp.org/www-community/attacks/Command_Injection"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://github.com/advisories/GHSA-7h8w-hj9j-8rjw"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-33718"
                }
            ],
            "scores": [
                {
                    "cvss_v3": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L",
                        "baseScore": 7.6,
                        "baseSeverity": "HIGH"
                    },
                    "products": [
                        "CSAFPID-5912815",
                        "CSAFPID-5912816",
                        "CSAFPID-5912817",
                        "CSAFPID-5912818",
                        "CSAFPID-5912819",
                        "CSAFPID-5912820",
                        "CSAFPID-5912821",
                        "CSAFPID-5912822",
                        "CSAFPID-5912823",
                        "CSAFPID-5912824",
                        "CSAFPID-5912825",
                        "CSAFPID-5912826",
                        "CSAFPID-5912827",
                        "CSAFPID-5912828",
                        "CSAFPID-5912829",
                        "CSAFPID-5920662"
                    ]
                }
            ],
            "title": "CVE-2026-33718"
        }
    ]
}