# CSRF token enforcement

> From OpenAEV 2.3.4, API calls from the interface carry a CSRF token. Upgrade the integrations and agents together with the platform to avoid 401 and 403 errors.

- URL: https://filigran.io/docs/deploy/upgrade/breaking-changes/openaev/2-3-4-csrf-token-enforcement/
- Products: OpenAEV 3.261118.0
- For: platform engineers
- Type: How-to guide

From OpenAEV 2.3.4, every API call that the OpenAEV interface makes must carry a valid Cross-Site Request Forgery (CSRF) token. It protects signed-in sessions, and every component that calls the OpenAEV API through a signed-in web session must support it. This page says what to upgrade together and how to check the result.

**Diagram: From OpenAEV 2.3.4, API calls from signed-in sessions carry a CSRF token, so upgrade every component that calls the API in the same window as the platform**

- Upgraded with the platform: OpenAEV interface (Signed-in web session), Injectors and collectors (Released for 2.3.4 or later), OpenAEV agents (Released for 2.3.4 or later), Your integrations (Updated for 2.3.4 or later)
- OpenAEV 2.3.4 and later: OpenAEV API (Expects a valid CSRF token)
- Left on older versions: Older components (Mixed versions)

Connections:

- OpenAEV interface → OpenAEV API: with CSRF token
- Injectors and collectors → OpenAEV API: API calls
- OpenAEV agents → OpenAEV API: API calls
- Your integrations → OpenAEV API: API calls
- OpenAEV API → Older components: 401 or 403 errors

| | Version |
| --- | --- |
| Introduced in | OpenAEV 2.3.4 |

## What breaks with mixed versions {#what-breaks-with-mixed-versions}

When the platform is on 2.3.4 or later and some components are older, API calls can fail at sign-in or when they change data:

- `401 Unauthorized` responses.
- `403 Forbidden` responses, for a missing or invalid CSRF token.
- Integrations that fail to create, update or trigger operations through the OpenAEV API.

## Upgrade together {#upgrade-together}

In the same maintenance window, upgrade the platform and every component that calls it, to versions released for OpenAEV 2.3.4 or later:

- injectors
- collectors
- OpenAEV agents
- other integrations
- your own integrations that use the API

> **Warning**
>
> Do not run mixed versions in production, for example OpenAEV 2.3.4 with older injectors or collectors.

With xtm-docker, the default collectors and injectors (the `openaev-integrations` profile) use the `latest` tag: `docker compose pull` and `docker compose up -d` upgrade them with the platform. See [Upgrade](https://filigran.io/docs/deploy/upgrade/).

## Check that it works {#check-that-it-works}

1. Sign in to OpenAEV and run a standard action, such as launching an inject.

   **Check that it worked**

   The action succeeds, with no authentication error.

2. Look for `401` and `403` responses in the logs of the platform and of the integrations.

   ```bash
   docker compose logs --since 1h | grep -wE '401|403'
   ```

   **Check that it worked**

   None of the lines it prints is an OpenAEV API call that failed, and no component reports a failed API connection.

## What's next {#what-s-next}

- [Upgrade](https://filigran.io/docs/deploy/upgrade/), the upgrade procedure.
- [How integrations run](https://filigran.io/docs/deploy/integrations/how-they-run/), to upgrade integrations you deployed yourself.
- [Breaking changes](https://filigran.io/docs/deploy/upgrade/breaking-changes/), the other changes per version.
