Skip to content

chore(release): 2.3.8 - #2784

Open
marcelogorutuba wants to merge 3 commits into
mainfrom
release/2.3.8
Open

marcelogorutuba wants to merge 3 commits into
mainfrom
release/2.3.8

Conversation

@marcelogorutuba

@marcelogorutuba marcelogorutuba commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Release 2.3.8

Security patch on top of 2.3.7: an instance's API key could act on other instances of the same installation (#2435). The fix has been on develop since May (#2549) but never shipped. This branch brings only that fix, without the rest of develop.

Merging publishes. The push to main rebuilds evoapicloud/evolution-api:latest. The numbered image v2.3.8 comes from a 2.3.8 tag on the merge commit, created after the merge.

What is in it

How it was tested

A real API and Postgres, with a fresh database per target: create two instances, then check that one instance's key cannot act on the other.

Target Create instance Instance key isolation
2.3.7 (published image) ✅ ❌
#2549 as backported (a9a7f5f9) ❌ 400, nothing stored not reachable
this branch ✅ ✅

The run used the same src/ as these commits: they were reworded and the version bump added afterwards, and git diff shows no change under src/.

Also on develop

develop has the same filter on the create body (src/api/abstract/abstract.router.ts) and the same createInstance(instance) call, so instance creation is likely broken there too. Not run: the published homolog image did not boot with this test's configuration (Prisma 7 needs a different datasource setup). Worth a follow-up PR to develop with the same change.

Summary by Sourcery

Release version 2.3.8 with the instance-isolation security fix.

Bug Fixes:

  • Prevent instance API keys from accessing resources belonging to other instances in the same installation.

Enhancements:

  • Preserve the instance name supplied when creating a new instance while protecting authenticated instance fields from untrusted query input.

Build:

  • Bump the package version to 2.3.8.

Documentation:

  • Add the 2.3.8 security release notes to the changelog.

Backport of #2549 (7a55a2b on develop) onto 2.3.7: an instance's API key could act on other instances of the same installation.
The backport also dropped the name from the body of /instance/create, the only place a new instance's name comes from, so create answered 400 and stored nothing. Create only passes the guard with the global key, so its body is trusted.
@sourcery-ai

sourcery-ai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

API

Prevent untrusted query parameters from overriding the authenticated instance, while preserving the trusted instance name supplied to /instance/create.

  • src/api/abstract/abstract.router.ts L20-34, L52-56

Configuration

Bump the package version to 2.3.8 for the release.

  • package.json L3

Documentation

Add the 2.3.8 changelog entry describing the instance-isolation security fix.

  • CHANGELOG.md L1-8

Lock files and vendored code

Update the package lockfile to match the 2.3.8 package version.

  • package-lock.json L3, L9

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/api/abstract/abstract.router.ts" line_range="20" />
<code_context>

 const logger = new Logger('Validate');

+const PROTECTED_INSTANCE_FIELDS = ['instanceName', 'instanceId'] as const;
+
+function sanitizeUntrustedInput(source: Record<string, any> | undefined): Record<string, any> {
</code_context>
<issue_to_address>
**Filtered fetches return every instance**

When a caller supplies `instanceName` or `instanceId` to `/instance/fetchInstances`, `sanitizeUntrustedInput` removes both filters before `InstanceController.fetchInstances` receives them, so the controller returns the unfiltered instance listing instead of the requested subset.

Preserve these fields as filters for `fetchInstances` while preventing them from overriding the authenticated instance on other routes.

Also at `src/api/abstract/abstract.router.ts:26-28`, `src/api/abstract/abstract.router.ts:52-53`.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: src/api/abstract/abstract.router.ts:20


Sourcery is free for open source - if you like our reviews please consider sharing them ✨


const logger = new Logger('Validate');

const PROTECTED_INSTANCE_FIELDS = ['instanceName', 'instanceId'] as const;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Filtered fetches return every instance

When a caller supplies instanceName or instanceId to /instance/fetchInstances, sanitizeUntrustedInput removes both filters before InstanceController.fetchInstances receives them, so the controller returns the unfiltered instance listing instead of the requested subset.

Preserve these fields as filters for fetchInstances while preventing them from overriding the authenticated instance on other routes.

Also at src/api/abstract/abstract.router.ts:26-28, src/api/abstract/abstract.router.ts:52-53.

Prompt for AI agents
In `src/api/abstract/abstract.router.ts` at line 20:

**Filtered fetches return every instance**

When a caller supplies `instanceName` or `instanceId` to `/instance/fetchInstances`, `sanitizeUntrustedInput` removes both filters before `InstanceController.fetchInstances` receives them, so the controller returns the unfiltered instance listing instead of the requested subset.

Preserve these fields as filters for `fetchInstances` while preventing them from overriding the authenticated instance on other routes.

Also at `src/api/abstract/abstract.router.ts:26-28`, `src/api/abstract/abstract.router.ts:52-53`.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant