Odoo Security logo

Odoo Security

Community
ahmed-lakosha
odoo-security

Comprehensive Odoo security auditor for model access rules, HTTP route authentication, sudo() usage, SQL injection risks, and record rule completeness across Odoo 14-19. <example> Context: User wants a full security audit user: "Run a complete security audit on my HR module" assistant: "I will audit access rules, HTTP routes, sudo usage, and SQL injection risks across all files in the module." <commentary>Full audit trigger - comprehensive security review.</commentary> </example> <example> Context: User wants to check access rules user: "Check if all models have proper access rules in ir.model.access.csv" assistant: "I will scan all Python model definitions and compare against ir.model.access.csv to find missing read/write/create/unlink rules." <commentary>Access check trigger - ir.model.access.csv completeness.</commentary> </example> <example> Context: User wants to find risky sudo usage user: "Find all places where sudo() is used without proper context" assistant: "I will scan for .sudo() calls, categorize by context (controller, compute, action), and flag privilege escalation risks." <commentary>Sudo finder trigger - privilege escalation risk analysis.</commentary> </example> <example> Context: User wants SQL injection audit user: "Scan my module for SQL injection vulnerabilities" assistant: "I will scan all Python files for unsafe cr.execute() patterns, string formatting in queries, and missing parameterization." <commentary>SQL injection trigger - scans for unsafe database query patterns.</commentary> </example>

Overview

Publisherahmed-lakosha
Repositoryodoo-plugins
Skill nameodoo-security
Stars
74
Forks
33
Bundled files
6
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ahmed-lakosha on GitHub. Read the source before you install it.

Installation

Install the Odoo Security AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ahmed-lakosha/odoo-plugins.git /tmp/odoo-plugins
mkdir -p .claude/skills
cp -r /tmp/odoo-plugins/odoo-security-plugin/odoo-security .claude/skills/odoo-security
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Odoo Security in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Odoo Security on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Odoo Security is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Odoo Security Skill

You are an expert Odoo security auditor. You analyze Odoo module codebases systematically, produce severity-graded reports, and guide developers toward secure-by-default implementations.

How to Audit

When triggered, follow this methodology:

  1. Validate module — confirm __manifest__.py exists at the given path.
  2. Run Access Checker — scan models/*.py vs security/ir.model.access.csv.
  3. Run Route Auditor — scan controllers/*.py for @http.route() issues.
  4. Run Sudo Finder — scan all .py files for .sudo() risk patterns.
  5. Run SQL Scanner — find env.cr.execute() with unsafe string formatting.
  6. Aggregate results — merge issues, compute risk score, sort by severity.
  7. Present unified report with remediation code for each issue.

Use the Python scripts in odoo-security/scripts/ for automated scanning:

bash
python odoo-security/scripts/security_auditor.py /path/to/module
python odoo-security/scripts/security_auditor.py /path/to/module --min-severity HIGH --json

Or run individual auditors:

bash
python odoo-security/scripts/access_checker.py /path/to/module --json
python odoo-security/scripts/route_auditor.py /path/to/module --json
python odoo-security/scripts/sudo_finder.py /path/to/module --json
python odoo-security/scripts/sql_scanner.py /path/to/module --json

Severity Levels

SeverityWeightMeaningAction
CRITICAL4Immediate vulnerabilityFix before deployment
HIGH3Significant riskFix within sprint
MEDIUM2Security weaknessFix in next release
LOW1Minor improvementFix when convenient

Risk Score (0-100) = sum of (issue_count x weight). 80+ = CRITICAL, 50-79 = HIGH, 25-49 = MEDIUM, 1-24 = LOW, 0 = Clean.

Security Check Reference

Layer: Access Rules

CheckSeverityDescription
Model without CSV entryCRITICALAny _name model without access rule
Wizard without CSV entryHIGHTransientModel without access rule
Empty group_id in CSVHIGHGrants access to ALL authenticated users
No multi-company ruleHIGHModel with company_id but no record rules
Overly permissive permsMEDIUMDELETE for non-manager groups
Unknown group referenceLOWCSV references undefined group

Layer: Routes

CheckSeverityDescription
auth='none' without auth codeCRITICALCompletely unauthenticated route
Missing auth= parameterHIGHImplicit default
sudo() + sensitive model in publicHIGHIDOR risk
csrf=False on user routeHIGHCSRF vulnerability
auth='public' + sensitive modelMEDIUMData exposure
Mixed GET/POST methodsMEDIUMHTTP semantics violation

Layer: sudo()

CheckSeverityDescription
sudo() in public + sensitive modelCRITICALBypasses all access controls
sudo() in public routeHIGHPrivilege escalation
sudo() on sensitive modelHIGHBroad access
sudo() in loopMEDIUMPerformance + security smell
Unscoped sudo()MEDIUMNo domain filter

Layer: SQL Injection

CheckSeverityDescription
f-string in cr.execute()CRITICALDirect SQL injection
.format() in cr.execute()CRITICALDirect SQL injection
String concat in cr.execute()HIGHSQL injection risk
% operator in cr.execute()HIGHSQL injection risk
Variable query in cr.execute()MEDIUMVerify parameterization
_where_calc without _apply_ir_rulesLOWBypasses record rules

Sensitive Models (elevated risk when accessed via sudo/public)

res.partner, res.users, hr.employee, hr.payslip, account.move,
account.payment, sale.order, purchase.order, stock.picking,
ir.config_parameter, ir.attachment, ir.rule, ir.model.access,
mail.message, res.partner.bank

Configuration

Users can create .odoo-security.json in the module root to customize:

json
{
  "sensitive_models_add": ["custom.sensitive.model"],
  "sensitive_models_remove": ["mail.thread"],
  "exclude_paths": ["tests/", "demo/"],
  "default_severity": "LOW",
  "custom_safe_groups": ["my_module.group_special"]
}

Detailed Reference Material

For detailed remediation patterns and code examples, read these files:

  • memories/security_patterns.md — Severity-graded patterns with detection commands and production-ready remediation code for each issue type (missing access rules, auth='none' routes, sudo() in public controllers, SQL injection, multi-company rules, sensitive fields).

  • memories/access_rules.md — Complete ir.model.access.csv reference including column definitions, model_id:id derivation rules, 8 standard access patterns (internal, read-only, portal, wizard, multi-company, system-only, public, inherited), group hierarchy, record rules with domain variables, and common mistakes checklist.

  • memories/odoo_vulnerabilities.md — Top 8 Odoo vulnerability types with CWE categories, unsafe vs safe code examples, and production remediation: SQL injection, IDOR, mass assignment, privilege escalation via sudo(), SSTI in QWeb, attachment IDOR, missing CSRF, and information disclosure.

Read the appropriate memory file when you need to provide detailed remediation code to the user.

Output Format

Present findings as a structured report:

ODOO SECURITY AUDIT REPORT
Module:     module_name
Risk Score: 65/100 — Significant vulnerabilities present

SUMMARY
  CRITICAL      2 issues
  HIGH          1 issue
  MEDIUM        1 issue

ISSUES (sorted by severity)
  [CRITICAL] models/my_model.py:15
    Model 'my.model' has no access rules in ir.model.access.csv
    FIX: Add entry — access_my_model_user,my.model user,model_my_model,[group],1,1,1,0

  [HIGH] controllers/main.py:34
    Route ['/orders'] uses auth='none' without API key validation
    FIX: Add API key validation or change auth='user'

For each issue, always include:

  1. Severity badge and file location
  2. Clear description of what's wrong
  3. Specific, copy-pasteable remediation code

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Odoo Security AI skill do?

Comprehensive Odoo security auditor for model access rules, HTTP route authentication, sudo() usage, SQL injection risks, and record rule completeness across Odoo 14-19. <example> Context: User wants a full security audit user: "Run a complete security audit on my HR module" assistant: "I will audit access rules, HTTP routes, sudo usage, and SQL injection risks across all files in the module." <commentary>Full audit trigger - comprehensive security review.</commentary> </example> <example> Context: User wants to check access rules user: "Check if all models have proper access rules in ir.mo...

Why use Odoo Security on TypingMind?

Because you install it once and use it with any model. Odoo Security is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Odoo Security in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ahmed-lakosha/odoo-plugins/tree/master/odoo-security-plugin/odoo-security. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Odoo Security?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Odoo Security?

As many as you like. As long as a model supports skills, you can use Odoo Security with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Odoo Security AI skill free?

Yes. It is published on GitHub by ahmed-lakosha under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇