Odoo API Key Rotation: What to Do When a Connected System Is Hacked
Odoo API key rotation after a connected PHP webshop or portal is hacked: what to revoke, how to rotate without downtime, and what to check in Odoo 20.
On 21 October 2026 PHP shipped emergency fixes for two critical PHP2shell flaws. Odoo was not the target, but many Odoo databases trust a PHP webshop or portal. Our Odoo integration services team now gets one question daily: is our Odoo exposed?
This guide is for IT leads and Odoo admins who run Odoo next to WooCommerce, Magento, PrestaShop or a custom PHP portal. For the API basics, start with our Odoo API integration guide; this post covers what to do when trust breaks.
Is Odoo affected when a connected PHP system is compromised?
Odoo is not directly affected by a PHP vulnerability, but a compromised PHP system can hand an attacker the keys it uses to reach Odoo. That makes it an Odoo security problem even though the flaw is elsewhere.
The PHP2shell flaws, CVE-2026-109618 and CVE-2026-109619, allow remote code execution on web servers that run PHP. Fixed releases are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. An attacker with code execution can read config files, environment variables and the database of that server.
That is where Odoo credentials usually live. A WooCommerce connector stores an Odoo URL, database name, login and API key or password. Whoever reads that file can call Odoo with the same rights as the connector, from anywhere.
So the right question is not "is Odoo vulnerable" but "what could someone do in Odoo with the credentials our webshop holds". If the answer is "create invoices, edit customers or export the price list", you rotate today.
What Odoo credentials can a connected system hold?
A connected system can hold Odoo credentials going in, and Odoo can hold that system's credentials going out. Both directions need rotation after a breach.
| Credential | Where it lives | What an attacker can do | Rotation action |
|---|---|---|---|
| Odoo API key | Connector config on the webshop or middleware | Call Odoo as the key's user | Revoke the key, issue a new one |
| Odoo user password | Older XML-RPC connectors | Call the API and possibly log in | Reset the password, enable 2FA |
| Odoo session cookie | Admin browser on an infected machine | Act inside the web interface | Log out from all devices |
| Storefront or payment token | Stored in Odoo integration settings | Act on the other platform | Ask the vendor to reissue it |
| Webhook secret or URL | Odoo automation rules, the other side's settings | Send fake events to either side | Change the secret and URL token |
| Middleware credentials | n8n, Make, Zapier or a custom script | Read and write both systems | Rotate both ends of every flow |
The last row is the one most teams forget. A no-code flow often holds full credentials for both Odoo and the store. Our n8n Odoo integration guide shows where those credentials sit.
How do Odoo API keys work from Odoo 14 to Odoo 20?

Odoo API keys replace the password for external calls, and each version since Odoo 14 has added more control over expiry and revocation. Your incident plan depends on which version you run.
| Capability | Odoo 14 to 17 | Odoo 18 | Odoo 19 and 20 |
|---|---|---|---|
| API keys available | Yes, used in place of the password | Yes | Yes, bearer token for JSON-2 |
| Key expiration date | No, keys last until deleted | Yes, chosen at creation | Yes, chosen at creation |
| Non-admin maximum duration | No limit | 90 days for internal users | 90 days for regular users |
| Admin "never expires" option | Every key is permanent | Persistent Key option | Persistent or Never option |
| Revoke through the API | No, delete in the interface | No, delete in the interface | Yes, revoke method in JSON-2 |
| Recommended for new integrations | Upgrade first | Keys with short expiry | JSON-2 with a dedicated bot user |
Odoo's API key documentation for Odoo 17 says a key gives essentially the same access as the user's password, although it cannot be used to log in to the web interface. Treat a leaked key exactly like a leaked password.
The key is a 160-bit random value shown only once. Odoo stores a hash, so nobody can read an existing key back from the database. If you lost track of which key went where, you cannot look it up; you can only delete and reissue.
If you are still on Odoo 17 or older, your keys never expire, and Odoo 17 standard support ended in September 2026. Our post on unsupported Odoo version security risks explains why that doubles the exposure.
When should you rotate an Odoo API key?
Rotate an Odoo API key on a schedule and immediately after any event that could have exposed it. A schedule handles slow leaks; events handle fast ones.
Rotate at once when any of these happen:
- A connected server, plugin or hosting account is compromised or patched for a critical flaw.
- A developer, agency or freelancer with access to the connector leaves the project.
- A key was pasted into a ticket, chat, email, Git repository or shared document.
- You see API calls from an unknown IP address or at odd hours in your logs.
- An Odoo user who owns an integration key changes role or leaves.
- You change hosting, move to Odoo.sh, or restore a database copy to a test server.
For scheduled rotation, Odoo's external API documentation says long-lasting keys must be rotated at least once every three months. Shorter is better for keys on public-facing systems.
How do you rotate an Odoo API key without breaking the integration?
Create the new key first, deploy it, confirm traffic moves, then revoke the old one. In a confirmed breach, flip the order and revoke first, accepting a short outage.
This is the planned rotation sequence we use, and it matches Odoo's own best practice list for Odoo 19 and 20:
- List every integration and the Odoo user and key description each one uses.
- Log in as the integration's bot user, or as an admin acting for it, and open Preferences, then Account Security.
- Click New API Key (Add API Key in newer screens), give it a clear description with the system name and date, and pick an expiry.
- Copy the key into the connector's secret store, never into code, chat or email.
- Restart or reload the connector, then run one test order, stock update or invoice sync.
- Check that new records show the bot user as the author and that no 401 "Invalid apikey" errors appear.
- Delete the old key in Account Security, or call the revoke method using the new key.
- Record the date, owner and next rotation date in your runbook.
On Odoo 19 and 20 an admin can script steps 3 and 7 with the res.users.apikeys generate and revoke methods. Odoo suggests authenticating with the new key to revoke the old one. By default only users with Settings access can call these methods.
On XML-RPC, the key replaces the password in the same login call. XML-RPC and JSON-RPC are deprecated in Odoo 20, so plan the move with our Odoo JSON-2 API migration guide.
How do you revoke an Odoo API key in an emergency?
In a live incident, revoke every key the compromised system could reach, block its user, and only then work out what happened. Speed matters more than a clean handover.
Use the fastest tool that fits:
| Situation | Fastest action in Odoo | Effect |
|---|---|---|
| You know which key leaked | Delete it in the user's Account Security tab | That key stops working at once |
| You are not sure which key | Settings, Manage API Keys, delete all keys for that user | Every key for that user stops working |
| The integration user may be abused in other ways | Archive the integration user | Odoo rejects API keys of inactive users |
| An admin browser may be infected | Log out from all devices on that user | Active web sessions end |
| A password was stored, not a key | Reset the password and turn on 2FA | Password login over RPC stops |
| Many systems shared one user | Create one bot user per system, then revoke | Limits the next incident |
The Manage API Keys screen sits in Settings for administrators and lists keys for all users. The devices list and the log out option are covered in Odoo's user devices guide.
Archiving is the blunt tool. Odoo only accepts keys whose user is active, so archiving the integration user cuts off every key it owns. Orders will stop flowing, so tell sales and warehouse teams before you do it.
What should you check in Odoo after revoking a compromised key?
After revocation, look for what the attacker may have changed or created while the key worked. Odoo records who created and last changed each record, which is why a dedicated bot user makes the review fast.
Work through this review list:
- Open Manage API Keys and delete any key you did not create, including keys on admin users.
- Check the user list for new users, new admin rights or changed email addresses.
- Filter recent invoices, vendor bank accounts and payments by "last updated by" the integration user.
- Review customer and supplier records for changed bank details, the classic payment fraud path.
- Look at Odoo.sh or server logs for API calls from unknown IP addresses during the exposure window.
- Check outgoing email and automation rules for anything added or edited recently.
Point 1 matters on Odoo 19 and 20. If a leaked key belonged to an admin, the attacker could create new keys through the API, and revoking only the original key leaves them in.
Our Odoo shared user account guide explains why a shared login ruins this audit: when five people and two connectors use one user, you cannot tell which change came from where.
How do you limit the damage of the next leaked Odoo API key?
Give each integration its own bot user with the fewest rights it needs, a short-lived key and no password login. Then a leak exposes one narrow lane, not your whole database.
| Setting | Weak setup we often find | Safer setup |
|---|---|---|
| Who owns the key | The admin or the founder's user | One Odoo bot user per integration |
| Access rights | Full Settings or Accounting rights | Only the models the connector needs |
| Password | Real password, used by the connector | Empty password, key only |
| Expiry | Persistent key with no end date | 30 to 90 days with a calendar reminder |
| Storage | Plain text in a plugin settings page | Secret store or server environment variable |
| Two-factor | Off for admin users | 2FA on every human admin |
Odoo's own documentation recommends dedicated bot users, minimum permissions and an empty password for API users. For human admins, follow Odoo's two-factor authentication guide, so a stolen password alone is not enough.
Set access with Odoo's access rights settings and test them: try to open an accounting report as the bot user. If it works and the connector only syncs stock, the rights are too wide.
The same rules apply to AI agents. An MCP server holds an Odoo key just like a webshop, so scope it the same way, as we explain in our Odoo 20 MCP server guide.
Which tokens does Odoo hold for other systems, and how do you rotate them?
Odoo often stores API tokens for your storefront, marketplace, payment and shipping accounts, and those need rotation too. If the attacker reached Odoo or its server, assume those tokens are exposed.
Most eCommerce connectors keep the other platform's credentials inside Odoo settings. Rotation happens on the other platform: issue a new token there, paste it into Odoo, run a test sync, then delete the old token on the platform.
For webhooks, change the shared secret and any token in the URL, since an old webhook URL lets anyone send fake orders. Our Odoo eCommerce integration guide covers how these sync flows are wired.
Which industries carry the most Odoo integration credential risk?
Businesses whose Odoo talks to public-facing PHP systems or payment flows carry the highest risk, because those systems face the internet all day. The table shows where we focus first.
| Industry | Pain or cost driver | Odoo approach | How iVentureTeam helps |
|---|---|---|---|
| Retail and eCommerce | WooCommerce or Magento holds an Odoo key with order and stock rights | Bot user limited to sales, stock and partners | Rotate keys, retest order flow, add expiry |
| Distribution and B2B | Customer portal in PHP writes quotes into Odoo | Separate portal bot user, no accounting rights | Access rights review and portal hardening |
| Healthcare and clinics | Patient portal tied to Odoo invoicing | Minimum fields, 2FA for all admins | Access audit and data exposure review |
| Professional services | Timesheet or billing tools sync via middleware | One key per flow in the middleware | Map flows and rotate both ends |
| Manufacturing | Supplier or dealer portal places orders | Dealer bot user with purchase or sales only | Rights design and rotation runbook |
How iVentureTeam helps with Odoo API key rotation

We find every credential your integrations use, rotate it without stopping orders, and leave you a runbook for next time. We have delivered 150+ ERP projects across 35+ countries with 40+ Odoo specialists over 13+ years.
- Integration inventory: every connector, middleware flow, webhook and AI agent mapped to the Odoo user and key it uses.
- Planned or emergency rotation: new keys deployed, tests run, old keys revoked, with the sales and warehouse teams kept informed.
- Bot user hardening: dedicated users, minimum rights, empty passwords and 2FA on human admins.
- Post-incident review: record changes, bank detail edits and unknown keys checked across the exposure window.
- Ongoing care: scheduled rotation and monitoring through our Odoo ERP support plans.
Not sure where your setup stands? Start with our free Odoo health check tool before you plan the rotation work.
Odoo integration credentials case study: a North American retailer
A retail eCommerce operator kept its Lightspeed storefront and connected it to Odoo, with the API credentials managed inside the Odoo back end. It shows why the outbound direction of rotation matters.
The retailer's storefront ran on Lightspeed eCommerce while operations moved to Odoo. Before the connector, products, orders and customers existed twice, and online stock drifted from the warehouse.
We built a scheduled, two-way connector in 6 weeks. It imports 9 record types from Lightspeed into Odoo and exports 3 data streams back, including prices, stock and order status. Credential setup and mapping live in Odoo, with no external middleware.
That design means rotating the Lightspeed credentials is one change inside Odoo, followed by a test sync. Read the Lightspeed and Odoo two-way integration case study.
The bottom line on Odoo API key rotation
If a system connected to Odoo is compromised, revoke what it held, issue new keys to dedicated bot users, and check what changed while the old keys worked. Odoo may be untouched, but its trust in that system is not.
Most teams find the real gap is not the flaw itself but the lack of a list: which systems hold which keys, owned by which users. Build that list now, set expiry dates, and the next rotation becomes a routine half-day task.
Ready to rotate your Odoo integration keys safely?

Get every connector, key and bot user checked before the next breach headline. Request an Odoo integration security review, call +91-90235-15208, or email business@iventureteam.com.
Frequently Asked Questions
Is Odoo affected by the PHP2shell vulnerability?
+
Odoo itself is written in Python and does not run on PHP, so the flaw does not hit Odoo directly. The risk is a connected PHP webshop, portal or middleware that stores Odoo API keys or passwords.
How do I revoke an Odoo API key?
+
Open the user's Preferences, then Account Security, and delete the key. Administrators can delete any user's keys from Settings, Manage API Keys. On Odoo 19 and 20 you can also call the revoke method through the JSON-2 API.
How often should Odoo API keys be rotated?
+
Odoo's documentation says long-lasting keys must be rotated at least once every three months. Rotate keys on public-facing systems more often, and immediately after any breach, staff change or accidental exposure.
Do Odoo API keys expire?
+
From Odoo 18 you choose an expiration date when you create a key, and non-admin users are capped at 90 days by default. Administrators can still create keys that never expire. Keys created in Odoo 14 to 17 last until deleted.
Can I see an existing Odoo API key again?
+
No. Odoo shows the key once at creation and stores only a hash. If you lost it or do not know where it is used, delete it and create a new one with a clear description.
What is an Odoo bot user?
+
It is a dedicated Odoo user created only for one integration, with the minimum access rights it needs and no password login. Odoo recommends bot users for automated API access, which limits damage if a key leaks.
Does changing the user's password revoke Odoo API keys?
+
Do not rely on it. Delete the keys directly or archive the integration user, since Odoo rejects API keys of inactive users. Then reset the password as a separate step if the connector ever stored it.
Do I need 2FA if my integrations use API keys?
+
Yes, for every human admin. With 2FA on, a stolen password alone is not enough to log in, and external tools must use API keys instead of passwords. Bot users should use keys with an empty password.
Free integration feasibility review
Moving your integrations to the new Odoo API?
Tell us which systems call Odoo today. We check what changes in Odoo 20, plan the move and keep your data flowing while it happens.
Free, with no obligation. A senior consultant replies within 12 business hours.
Free Odoo tools
All tools- Odoo Health CheckVersion, modules, findings and upgrade cost
- Odoo App SelectorWhich apps you need, by industry
- Odoo Project EstimateIndicative cost and timeline in minutes
- Odoo Implementation Cost CalculatorImplementation cost and timeline, in minutes
- Odoo Migration Cost CalculatorVersion jump or legacy ERP, priced in minutes
Continue reading
Odoo JSON-2 API Migration: Move XML-RPC Integrations to Odoo 20
Odoo JSON-2 API migration guide: XML-RPC deprecation dates, bearer API keys, Python call mapping, error handling and a cut-over checklist for Odoo 19 and 20.
Odoo Saudi Bank Integration: Statement Sync, Reconciliation, SADAD
Odoo Saudi bank integration explained: bank sync coverage, CAMT and Excel statement import, SAR auto-reconciliation, ISO 20022, WPS and SADAD in Odoo 19/20.
Odoo Payment Gateway Integration in MENA: Fawry, Tap, Moyasar, POS
Odoo payment gateway integration for MENA: built-in Paymob and APS, custom Fawry, Tap and Moyasar connectors, POS terminals, reconciliation and costs.
