Repository navigation
chore(release): 2.3.8 - #2784
marcelogorutuba wants to merge 3 commits into
Conversation
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.
Reviewer's GuideAPIPrevent untrusted query parameters from overriding the authenticated instance, while preserving the trusted instance name supplied to
ConfigurationBump the package version to 2.3.8 for the release.
DocumentationAdd the 2.3.8 changelog entry describing the instance-isolation security fix.
Lock files and vendored codeUpdate the package lockfile to match the 2.3.8 package version.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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
|
|
||
| const logger = new Logger('Validate'); | ||
|
|
||
| const PROTECTED_INSTANCE_FIELDS = ['instanceName', 'instanceId'] as const; |
There was a problem hiding this comment.
🟡 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`.
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
developsince May (#2549) but never shipped. This branch brings only that fix, without the rest ofdevelop.Merging publishes. The push to
mainrebuildsevoapicloud/evolution-api:latest. The numbered imagev2.3.8comes from a2.3.8tag on the merge commit, created after the merge.What is in it
a9a7f5f9: backport of security: prevent cross-instance auth bypass via query/body override (CVE pending, #2435) #2549.9ea7c0ef: keeps the body name on/instance/create. security: prevent cross-instance auth bypass via query/body override (CVE pending, #2435) #2549 also filters the request body there, and create takes the new instance's name from the body, so as backported create answered 400 and stored nothing. Create only passes the auth guard with the global key, so that body is trusted.b97d3335: version 2.3.8 and the CHANGELOG entry.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.
a9a7f5f9)The run used the same
src/as these commits: they were reworded and the version bump added afterwards, andgit diffshows no change undersrc/.Also on
developdevelophas the same filter on the create body (src/api/abstract/abstract.router.ts) and the samecreateInstance(instance)call, so instance creation is likely broken there too. Not run: the publishedhomologimage did not boot with this test's configuration (Prisma 7 needs a different datasource setup). Worth a follow-up PR todevelopwith the same change.Summary by Sourcery
Release version 2.3.8 with the instance-isolation security fix.
Bug Fixes:
Enhancements:
Build:
Documentation: