The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-27953

CVE-2026-27953: ormar Python ORM Privilege Escalation Flaw

CVE-2026-27953 is a privilege escalation vulnerability in ormar Python ORM that allows attackers to bypass validation and inject unvalidated data. This article covers technical details, affected versions, impact, and mitigation.

Published: March 19, 2026

CVE-2026-27953 Overview

CVE-2026-27953 is a Pydantic validation bypass vulnerability in ormar, an async mini ORM for Python. Versions 0.23.0 and below are vulnerable to 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. This vulnerability enables attackers to persist unvalidated data directly to the database, leading to privilege escalation, data integrity violations, and business logic bypass.

A secondary attack vector exists through the __excluded__ parameter injection, which uses the same pattern to selectively nullify arbitrary model fields (e.g., email or role) during construction. This vulnerability specifically affects ormar's canonical FastAPI integration pattern recommended in its official documentation.

Critical Impact

Unauthenticated attackers can bypass all Pydantic field validation and persist malicious data directly to the database, enabling privilege escalation and business logic bypass in any application using ormar.Model directly as a request body parameter.

Affected Products

  • ormar versions ≤ 0.23.0
  • Applications using ormar.Model directly as FastAPI request body parameters
  • Python applications using the ormar async ORM with Pydantic validation

Discovery Timeline

  • 2026-03-19 - CVE CVE-2026-27953 published to NVD
  • 2026-03-19 - Last updated in NVD database

Technical Details for CVE-2026-27953

Vulnerability Analysis

This vulnerability stems from improper input validation (CWE-20) in ormar's model construction process. When ormar models are used as FastAPI request body parameters, the framework passes user-controlled JSON data directly to the model constructor. The internal __pk_only__ flag, intended for internal ORM operations when retrieving partial objects from the database, was inadvertently exposed to user input. When this flag is set to true in a request body, ormar bypasses all Pydantic validation logic, treating the object as a partial primary-key-only instance.

The attack is particularly severe because it targets the officially recommended FastAPI integration pattern documented in ormar's examples. Any application following the official FastAPI quick start example is vulnerable by default. The network-accessible attack vector with low complexity makes this vulnerability exploitable without requiring special privileges.

Root Cause

The root cause lies in the NewBaseModel implementation where internal constructor parameters (__pk_only__ and __excluded__) were not properly sanitized from external input. These parameters control critical validation logic:

  1. __pk_only__: When set to true, signals the model to skip full validation and treat the instance as containing only a primary key reference
  2. __excluded__: Allows specifying which fields should be excluded (nullified) during model construction

The NewBaseModel implementation accepted these parameters from any source, including untrusted user input in HTTP request bodies.

Attack Vector

An attacker can exploit this vulnerability by sending a malicious JSON payload to any FastAPI endpoint that accepts an ormar model as a request body parameter. The attack requires no authentication and can be performed remotely over the network.

Validation Bypass Attack:
By including "__pk_only__": true in the JSON request body, all Pydantic field validators are bypassed, allowing:

  • Invalid data types to be persisted
  • Required fields to be omitted
  • Constraint violations to go undetected

Field Nullification Attack:
By injecting "__excluded__": ["email", "role"], an attacker can selectively nullify critical fields during model construction, potentially:

  • Removing email verification requirements
  • Bypassing role-based access controls
  • Nullifying audit fields
python
# Source: https://github.com/ormar-orm/ormar/commit/7f22aa21a7614b993970345b392dabb0ccde0ab3
# Security patch in ormar/models/model_row.py - Fix/remove kwargs injection (#1582)

         instance: Optional["Model"] = None
         if item.get(cls.ormar_config.pkname, None) is not None:
-            item["__excluded__"] = cls.get_names_to_exclude(
+            excluded = cls.get_names_to_exclude(
                 excludable=excludable, alias=table_prefix
             )
-            instance = cast("Model", cls(**item))
+            instance = cast("Model", cls._construct_with_excluded(excluded, **item))
             instance.set_save_status(True)
         return instance

Detection Methods for CVE-2026-27953

Indicators of Compromise

  • HTTP request bodies containing __pk_only__ or __excluded__ parameters in JSON payloads
  • Database records with unexpected null values in required fields
  • Log entries showing successful data persistence with validation errors that should have been caught
  • Unusual patterns of privilege escalation or role modifications in application logs

Detection Strategies

  • Implement WAF rules to detect and block requests containing __pk_only__ or __excluded__ in JSON request bodies
  • Monitor application logs for database insertion operations that bypass expected validation patterns
  • Deploy SIEM rules to correlate unusual field modifications with specific user sessions
  • Audit database tables for records with invalid or unexpected null values in required fields

Monitoring Recommendations

  • Enable detailed logging for all FastAPI endpoints that accept ormar models as request bodies
  • Set up alerts for any HTTP requests containing suspicious internal parameter names in JSON payloads
  • Monitor for sudden changes in user roles or permissions without corresponding admin actions
  • Implement integrity checks on critical database fields to detect unexpected modifications

How to Mitigate CVE-2026-27953

Immediate Actions Required

  • Upgrade ormar to version 0.23.1 or later immediately
  • Audit application code to identify all endpoints using ormar.Model directly as FastAPI request body parameters
  • Review database records created during the vulnerable period for data integrity issues
  • Implement input sanitization as a defense-in-depth measure to strip internal parameters from request bodies

Patch Information

The vulnerability has been fixed in ormar version 0.23.1. The fix introduces a new _construct_with_excluded method that separates internal construction parameters from user-provided input, preventing injection of internal flags through request bodies.

Detailed patch information is available in the GitHub Release 0.23.1 Details and the GitHub Security Advisory GHSA-f964-whrq-44h8.

Workarounds

  • If immediate upgrade is not possible, create wrapper Pydantic models that explicitly define allowed fields and validate input before passing to ormar models
  • Implement middleware to strip __pk_only__, __excluded__, and other internal ormar parameters from all incoming JSON request bodies
  • Use FastAPI's dependency injection to sanitize request data before it reaches ormar model constructors
  • Deploy WAF rules to block requests containing internal ormar parameter names as an interim protective measure
bash
# Upgrade ormar to patched version
pip install --upgrade ormar>=0.23.1

# Verify installed version
pip show ormar | grep Version

# If using requirements.txt, update the pinned version
sed -i 's/ormar.*/ormar>=0.23.1/' requirements.txt

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechOrmar

  • SeverityHIGH

  • CVSS Score7.1

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-20
  • Technical References
  • GitHub FastAPI Quick Start Example

  • GitHub Foreign Key Implementation

  • GitHub Pydantic Helper Code

  • GitHub Model Definition File

  • GitHub NewBaseModel Implementation

  • GitHub NewBaseModel Update

  • GitHub Commit History Change

  • GitHub Release 0.23.1 Details

  • GitHub Security Advisory GHSA-f964-whrq-44h8
  • Related CVEs
  • CVE-2026-26198: Collerek Ormar SQLI Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English