high CVSS 7.1

CVE-2026-27953·Python vulnerability

ormar is a async mini ORM for Python. Versions 0.23.0 and below are vulnerable to Pydantic validation bypass through the model constructor, allowing any unauthenticated user to skip all field validation by injecting "__pk_only__": true into a JSON request body. By injecting "__pk_only__": true into a JSON request body, an unauthenticated attacker can skip all field validation and persist unvalidated data directly to the database. A secondary __excluded__ parameter injection uses the same pattern to selectively nullify arbitrary model fields (e.g., email or role) during construction. This affects ormar's canonical FastAPI integration pattern recommended in its official documentation, enabling privilege escalation, data integrity violations, and business logic bypass in any application using ormar.Model directly as a request body parameter. This issue has been fixed in version 0.23.1.

Severity
high
Software
Python
Fixed in
0.23.1
Published
2026-03-19

Affected versions

Until: 0.23.1

Fixed in: 0.23.1

How to fix this CVE

Upgrade ormar to version 0.23.1 or later to patch the Pydantic validation bypass vulnerability. If you are using ormar as a request body parameter in FastAPI applications, ensure your deployment runs the patched version immediately. Review any FastAPI endpoints that accept ormar.Model instances directly and consider adding additional server-side validation layers as a defense-in-depth measure.

sudo dnf update python3-ormar

Defensia detects this vulnerability

What an exploitation attempt looks like

Sample log line indicative of exploitation attempts:

POST request containing JSON body with __pk_only__:true or __excluded__ parameters sent to FastAPI endpoints accepting ormar.Model objects. Example pattern: ("__pk_only__"\s*:\s*true|"__excluded__"\s*:\s*\{)

WAF mitigation (if patching is not yet possible)

Add this rule to your WAF to block exploitation attempts while you schedule the patch.

Implement JSON schema validation at the WAF level to reject any incoming request bodies containing keys matching /__pk_only__|__excluded__/ before they reach the FastAPI application. Configure WAF rules to block JSON payloads with these parameter names targeting endpoints known to accept ormar.Model instances.

How to check if you are affected

  1. Step 1: Check ormar version with: python3 -c "import ormar; print(ormar.__version__)"
  2. Step 2: Identify FastAPI applications using ormar by searching for ormar.Model imports: grep -r "from ormar import" /path/to/app/ && grep -r "ormar.Model" /path/to/app/
  3. Step 3: Search application logs for suspicious JSON payloads containing "__pk_only__" or "__excluded__" parameters: grep -i '__pk_only__\|__excluded__' /var/log/app/*.log
  4. Step 4: After upgrading, verify the patched version is running: python3 -c "import ormar; print(ormar.__version__)" and confirm it shows 0.23.1 or higher

Indicators of compromise

  • __pk_only__:true in JSON request body
  • __excluded__ parameter injection in request payload
  • FastAPI POST requests to /path accepting ormar.Model with unusual field values

FAQ

What is CVE-2026-27953?

CVE-2026-27953 is a validation bypass flaw in ormar that allows attackers to inject special parameters (__pk_only__ and __excluded__) into JSON request bodies to skip field validation and persist unvalidated data directly to the database. This affects applications using ormar.Model as a FastAPI request parameter.

Is CVE-2026-27953 being actively exploited?

No, CVE-2026-27953 is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are currently available. However, the attack pattern is straightforward and organizations should prioritize patching.

What versions of ormar are affected by CVE-2026-27953?

All ormar versions 0.23.0 and below are vulnerable. Version 0.23.1 and later include the fix.

How do I check if my server is vulnerable to CVE-2026-27953?

Run: python3 -c "import ormar; v = ormar.__version__.split('.'); print('Vulnerable' if int(v[1]) <= 23 and int(v[2]) < 1 else 'Patched')" to quickly determine if your installation is affected.

Does Defensia detect CVE-2026-27953?

Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If ormar is installed on a monitored server, CVE-2026-27953 will appear in your dashboard with remediation steps.

Related Python CVEs

CVE-2026-33054CVSS 10Mesop is a Python-based UI framework that allows users to build web applications. Versions 1.2.2 and below contain a Path Traversal vulnerability that allows any user supplying an untrusted state_token through the UI stream payload to arbitrarily target files on the disk under the standard file-based runtime backend. This can result in application denial of service (via crash loops when reading non-msgpack target files as configurations), or arbitrary file manipulation. This vulnerability heavily exposes systems hosted utilizing FileStateSessionBackend. Unauthorized malicious actors could interact with arbitrary payloads overwriting or explicitly removing underlying service resources natively outside the application bounds. This issue has been fixed in version 1.2.3.
CVE-2026-28505CVSS 10Tautulli is a Python based monitoring and tracking tool for Plex Media Server. Prior to version 2.17.0, the str_eval() function in notification_handler.py implements a sandboxed eval() for notification text templates. The sandbox attempts to restrict callable names by inspecting code.co_names of the compiled code object. However, co_names only contains names from the outer code object. When a lambda expression is used, it creates a nested code object whose attribute accesses are stored in code.co_consts, NOT in code.co_names. The sandbox never inspects nested code objects. This issue has been patched in version 2.17.0.
CVE-2026-34938CVSS 10PraisonAI is a multi-agent teams system. Prior to version 1.5.90, execute_code() in praisonai-agents runs attacker-controlled Python inside a three-layer sandbox that can be fully bypassed by passing a str subclass with an overridden startswith() method to the _safe_getattr wrapper, achieving arbitrary OS command execution on the host. This issue has been patched in version 1.5.90.
CVE-2026-25632CVSS 10EPyT-Flow is a Python package designed for the easy generation of hydraulic and water quality scenario data of water distribution networks. Prior to 0.16.1, EPyT-Flow’s REST API parses attacker-controlled JSON request bodies using a custom deserializer (my_load_from_json) that supports a type field. When type is present, the deserializer dynamically imports an attacker-specified module/class and instantiates it with attacker-supplied arguments. This allows invoking dangerous classes such as subprocess.Popen, which can lead to OS command execution during JSON parsing. This also affects the loading of JSON files. This vulnerability is fixed in 0.16.1.
CVE-2026-26030CVSS 9.9Semantic Kernel, Microsoft's semantic kernel Python SDK, has a remote code execution vulnerability in versions prior to 1.39.4, specifically within the `InMemoryVectorStore` filter functionality. The problem has been fixed in version `python-1.39.4`. Users should upgrade this version or higher. As a workaround, avoid using `InMemoryVectorStore` for production scenarios.

References

Track CVEs across your fleet automatically

Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-27953. Free for 1 server.

Get started free