Skip to content

chore(release): promote release to master - #42661

Merged
appsmith-promotion[bot] merged 7 commits into
masterfrom
release
Nov 20, 2026
Merged

appsmith-promotion[bot] merged 7 commits into
masterfrom
release

Conversation

@appsmith-smithes

@appsmith-smithes appsmith-smithes Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Promote release to master.

Commits

Automation

/ok-to-test tags=""

Warning

Tests have not run on the HEAD f31e8f8 yet


Fri, 20 Nov 2026 05:32:48 UTC

amelia-c0n and others added 7 commits November 19, 2026 10:37
…2655)

## Description

Problem: `pr-labeler.yml` used `appsmithorg/labeler@master`, a Docker
action that is compiled from source on every run. The compile depends on
Docker Hub, the Alpine package servers and several Go module hosts.
gopkg.in failures on 2026-11-11 and 2026-11-18 (UTC) failed every run of
the workflow in those windows.

The fix: Set the same five labels with the `gh` CLI that is already on
the runner. A run depends only on GitHub and takes about 10 seconds.

Tradeoff: The title rules live in the workflow script.
`.github/labeler.yml` is removed, because nothing else reads it.

Fixes https://linear.app/appsmith/issue/APP-16473

### Behavior that stays the same

| Title starts with | Labels set |
|---|---|
| `feat:` or `feature:` | Enhancement |
| `fix:` | Bug |
| `ci:` | CI, skip-changelog |
| `test:` | Test, skip-changelog |
| `doc:` or `chore:` | skip-changelog |

- When the title stops matching, the workflow removes the label. It does
not touch any label outside these five.
- The match is a case-sensitive prefix. `fix(widgets): …` and `docs: …`
match no rule, as before.
- The triggers are unchanged: `opened`, `reopened` and `edited` on PRs
into `release`.

### Behavior that changes

- **PRs from forks are skipped.** The token is read-only on a fork PR.
The action never labeled those PRs: it logged a 403 and exited 0.
- **An error while labeling turns the job red.** The old workflow could
fail in two places. A failed build of the action turned the job red, and
that build step no longer exists. An error while the action read the PR
or wrote a label was only logged, and the job stayed green with no label
set. That second kind of error now turns the job red.
- **The workflow declares `permissions: pull-requests: write`.** It had
no `permissions:` block before.
- **One run at a time per PR.** A concurrency group queues a newer run
until the active run ends. Each run reads the title and the labels when
it starts, not from the event payload. Several quick edits therefore end
on the labels of the latest title. A queued run that a newer edit
replaces shows as cancelled in the Actions list.
- **The workflow writes only when a label has to change.** The action
replaced the full label set on every run.

### Call sites checked

- `appsmithorg/labeler` and `.github/labeler.yml` have no other
reference in this repository or in the EE repository.
- Dependabot PRs carry none of the five labels and their titles
(`chore(deps): …`) match no rule, so the workflow makes no write on
them.

### Verification

- The script passes `bash -n` and `shellcheck`. It has no `${{ }}`
inside the `run:` body, and it never prints the PR title.
- A table test with a stubbed `gh` covers 16 titles and label sets,
including lower-case label names and a title that contains shell syntax.
Changing one rule makes the test fail.
- In the EE repository, a draft PR ran this workflow across five title
changes (`ci:`, `fix:`, `refactor:`, `feat:`, `test:`). Every run set
the expected labels with only the `pull-requests: write` permission. The
EE repository names two of the labels in lower case (`bug`,
`enhancement`), and the workflow handles both spellings.
- In the EE repository, a second draft PR received four title edits back
to back. Two runs ran one after the other, two queued runs were
cancelled, and the labels matched the last title.
- This PR runs the workflow on itself. The `CI` and `skip-changelog`
labels on it come from that run.

### Impact on existing instances

None. This is a CI-only change.

## Automation

/ok-to-test tags="@tag.Sanity"

## Testing

Select the validation relevant to this change:

- [ ] Client unit tests
- [ ] Server unit tests
- [x] Cypress
- [ ] Playwright
- [ ] Deploy preview
- [ ] Not applicable

Suggested Cypress tags or specs: `@tag.Sanity`. The change cannot affect
the app. The run is there because `ci/merge-gate` requires a green
Cypress run for a workflow file change.

## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/44403799534>
> Commit: 46e8232
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=44403799534&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Wed, 18 Nov 2026 22:01:03 UTC
<!-- end of auto-generated comment: Cypress test results  -->

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
## Description

This PR adds the server foundation for **Admin Settings → Support**
diagnostics. A super user will be able to review instance diagnostics by
section and download a ZIP to attach to a support ticket. Nothing is
sent to Appsmith automatically.

This is PR 1 of 3. No UI links to these endpoints until PR 3, so nothing
changes for users yet. The change was built and validated in EE first.

**What it adds**

| Part | What it does |
| --- | --- |
| `GET /api/v1/admin/support/diagnostics/sections` | Lists the nine
sections with any result kept from the last hour |
| `POST /api/v1/admin/support/diagnostics/sections/{sectionId}/collect`
| Collects one section, with a 10-second timeout |
| `POST /api/v1/admin/support/diagnostics/downloads` | Records that a
ZIP was downloaded (a log line for now). An empty section list returns
400. |
| Access check | Super user only. An empty result is rejected. The
multi-org hook `isMultiOrgInstance()` returns `false` in CE; an unknown
state is treated as multi-org and rejected. |
| `DiagnosticsRedactionGuard` | Rejects any section result with an
undeclared key, a non-plain value, a free-text category key, or more
than 100 KB |
| `DiagnosticsResultStore` | Keeps successful results in Redis for 1
hour. Each Redis call times out after 2 seconds and fails open. A
per-section lock returns 429 to a second concurrent collect. |
| Collectors | Instance (edition, version, commit, instance ID, uptime,
JVM, OS family and architecture) and Deployment (tool, cloud provider,
EFS, Appsmith Cloud, CPU, memory, replicas `UNKNOWN`). All values come
from fixed lists; anything else is reported as `other` or `UNKNOWN`. |

Logs never include exception messages, URLs, or user data.

**Call sites checked**
- No other controller maps a `/support` path under `/api/v1/admin`.
- The new path falls under the default `anyExchange().authenticated()`
rule in the security config.
- POSTs are covered by the global CSRF filter.

**Impact on existing instances**
- Fresh install, upgrade from default, upgrade from customized: three
new read-only endpoints for super users. No config, env var, Mongo, or
migration change. Redis keys `support_diagnostics:*` (1 hour) and
`support_diagnostics_lock:*` (30 seconds) appear only after a super user
calls the endpoints.
- Rollback: revert the PR. The Redis keys expire within an hour.

**CE/EE**
- EE validation PR: appsmithorg/appsmith-ee#10670.
- 23 files are identical to EE. `SupportDiagnosticsServiceImpl` is the
CE pass-through; EE overrides `isMultiOrgInstance()` with the multi-org
license flag.
- A local `git merge-tree` simulation of this commit against EE
`release` merges cleanly.

Fixes https://linear.app/appsmith/issue/APP-16558

## Testing

- [ ] Client unit tests
- [x] Server unit tests
- [ ] Cypress
- [ ] Playwright
- [ ] Deploy preview
- [ ] Not applicable

Run locally in CE (Redis on `127.0.0.1:6379`): `Diagnostics*Test`,
`SupportDiagnostics*Test`, `*DiagnosticsCollectorTest` — 113/113 pass.
Compile and test-compile pass. The full Cypress suite ran on the EE
validation PR.

Suggested Cypress tags or specs: `@tag.All`

## Automation

/ok-to-test tags="@tag.All"

## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/44376201557>
> Commit: 01dfe60
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=44376201557&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 18 Nov 2026 19:42:23 UTC
<!-- end of auto-generated comment: Cypress test results  -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Description

When a SQL Server query ran past its timeout, the user got the timeout
error on time, but the query kept running. It held a worker thread and a
pooled connection until it finished, and forever if it never finished.
This PR stops the query itself at its timeout.

Fixes internal security finding
[AIP-FD-38](https://app.hacktron.ai/appsmith-inc/findings/AIP-FD-38) (no
GitHub issue).

### The problem

The server wraps each plugin call in its own `.timeout()`
(`ActionExecutionSolutionCEImpl`). That timeout fires on time and
returns the standard timeout error, but it only stops waiting. The
plugin's own `.timeout()` never fired: the query runs as a blocking call
before that timer starts. So nothing stopped the query.

With a 3-second timeout, measured with the server's outer timeout in
place:

| Query | `release` (and before #42639) | This PR |
| --- | --- | --- |
| `SELECT 1; WHILE 1 = 1 SELECT 1` | Timeout error after 3 s. Connection
still in use 5 s later, and forever | Timeout error after 3 s.
Connection returned |
| `WAITFOR DELAY '00:00:20'` | Timeout error after 3 s. Query keeps
running on SQL Server until it ends at 20 s | Timeout error after 3 s.
Query cancelled on SQL Server, connection returned |

Before #42639 (driver 11.2.4) the endless queries hung the same way. So
this is not a regression from the driver upgrade. That PR moved the
endless reading into the plugin's own loop (`drainRemainingResults`,
which reads later results to find their errors), where the finding
spotted it.

### Changes

- `MssqlPlugin.executeCommon`: set the JDBC query timeout from the
action timeout, rounded up to whole seconds
(`MssqlExecuteUtils.queryTimeoutSeconds`). The driver cancels the query
on SQL Server when it runs out.
- `MssqlExecuteUtils`: check the same deadline for each row of the first
result and for each later result and row. When it passes, cancel the
query and fail with `QUERY_TIMEOUT_ERROR_MSG`: "The query ran longer
than its timeout of N ms, so Appsmith stopped it. Statements in the
query that already ran may have been saved."
- A driver timeout while later results are read is reported as a
timeout, not as "A statement in this query failed".
- If cancelling fails, the timeout is still reported.

### Behavior change

- **What users see does not change.** A query that runs past its timeout
still returns the standard error, `PE-QRY-5000` "<query> timed out in N
milliseconds. Please increase timeout…", at the timeout. The audit log
(EE) still records `query.executed` with status FAILED and response code
`PE-QRY-5000`. The server's timer starts before the plugin's, so the
server's error comes first. The plugin's own timeout message is a
backstop.
- **What changes:** the query is now cancelled on SQL Server at its
timeout. Before, it kept running in the background after the user saw
the timeout. For example, an `UPDATE` that timed out still finished
later. Now it stops. Statements that already ran may have been saved, as
before.

## Automation

/ok-to-test tags="@tag.All"

## Testing

- [ ] Client unit tests
- [x] Server unit tests
- [ ] Cypress
- [ ] Playwright
- [ ] Deploy preview
- [ ] Not applicable

- `MssqlDriverBehaviourTest#endlessLaterResults_stopAtTheQueryTimeout`
(Testcontainers, SQL Server 2022): endless results, endless update
counts and a 20-second `WAITFOR`, with prepared statements on and off.
It checks the exact error, that the query fails in under 10 seconds, and
that the connection goes back to the pool. On `release` it hangs or
wrongly succeeds.
- `MssqlExecuteUtilsTest` (mocked statements): the plugin's own deadline
cancels and fails, a driver timeout reads as a timeout, a later
statement's error before the deadline is still reported as a failed
statement, and the timeout rounds up to whole seconds.
- Full SQL Server plugin suite: 117 tests, 0 failures.

Suggested Cypress tags or specs: `@tag.Datasource`

## Communication
Should the DevRel and Marketing teams inform users about this change?
- [x] Yes
- [ ] No

## Release note

```release-note
When a SQL Server query runs past its timeout, Appsmith now also stops it on SQL Server. Before, the query kept running in the background after the timeout error, holding a database connection, and a slow `UPDATE` could still finish later. Statements in the query that ran before the timeout may already be saved. If a query needs more time, increase its timeout in the query's settings.
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)



<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/44590810359>
> Commit: 7d82f00
> Workflow: `PR Automation test suite`
> Tags: `@tag.All`
> Spec: ``
> <hr>Thu, 19 Nov 2026 18:43:46 UTC
<!-- end of auto-generated comment: Cypress test results  -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Problem: Signup and account activation need one rule for an email that
already has an account.

The fix: Form signup creates an account only for an email that has none.
An account that already exists becomes active through the password reset
link or single sign-on.

Tradeoff: An instance needs outbound mail or single sign-on to activate
an invited account. A follow-up adds a link an administrator can copy
for an instance with neither.

## Description

- `UserServiceCEImpl.createUser` returns `USER_ALREADY_EXISTS_SIGNUP`
for every email that already has an account, enabled or not. The error
text now also points to "Forgot password".
- `UserServiceCEImpl.resetPasswordAfterForgotPassword` runs
`isSignupAllowed` before it enables an account. A refused reset leaves
the token in place. System-generated accounts get no reset link, and
neither signup nor a reset link activates them.
- The signup form supplies the email, the password and the name. The
server sets the sign-in source and the enabled flag, and it does not
read the state from the form.
- One exception for the first account of an instance: when
`APPSMITH_ADMIN_EMAILS` names an email before anyone has joined, signup
with that email still activates the account, as long as no person has an
active account (`CustomUserRepositoryCE.hasNoActivatedUser`). This keeps
a new instance reachable without mail or single sign-on.
- Invitation mails for a new invitee link to the login page with
`activation=true` and the email. The login page shows a note on how to
activate the account and starts the form with the email.
- Tests: `AccountActivationGuardTest` drives `POST /api/v1/users` for
the refused cases, the first-admin case including an account that is
already active, and a new email. `PendingAccountPasswordResetTest`
covers activation by password reset. Email tests assert the exact link.
Jest tests cover the login note and the email field following the
invitation link, including that typed values are kept.

Advisory:
[GHSA-27hq-mrc7-w4qf](https://github.com/appsmithorg/appsmith/security/advisories/GHSA-27hq-mrc7-w4qf)

### Reviewer notes

- Start with `UserServiceCEImpl.createUser` and
`activateConfiguredAdminOnInstanceWithNoActiveAccount`. The rule lives
in `createUser` because it is the one method every form signup passes
through.
- Callers of `createUser` and `UserService.create` checked:
`UserSignupCEImpl.signupAndLogin`, `CustomOAuth2UserServiceCEImpl`,
`CustomOidcUserServiceCEImpl`, `SamlUserProvisioner`. The three sign-on
handlers call `create` only after their own lookup finds no account, so
they are unchanged.
- Places that enable an existing account, checked: password reset (now
runs the signup-allowed check and skips system-generated accounts), and
the OAuth2, OIDC and SAML handlers (unchanged).
- `UserSignupCEImpl.signupAndLoginFromFormData` reads the email, the
password and the name from the form. The server sets the sign-in source
and the enabled flag.
- Workspace and instance administrator invitation mails choose the link
from their existing `isNewUser` argument.
- The first-admin activation is one conditional update
(`CustomUserRepositoryCE.activatePendingAccount`), so it happens once
per account.
- `hasNoActivatedUser` is tested for the "an active account exists"
answer against the database. The other answer is stubbed, because the
shared test database always holds active accounts.
- Cypress: `Email_settings_Spec.ts` now creates its test account in the
setup step.

### Impact on existing instances

- **Fresh install:** Signup for a new email is unchanged. The setup page
is unchanged. An instance started with `APPSMITH_ADMIN_EMAILS` set still
lets the first configured admin sign up. Invited people need the
password reset mail or single sign-on.
- **Upgrade from default:** Active accounts are not affected. An invited
person activates the account with the password reset mail or single
sign-on. An invitation link sent before the upgrade opens the signup
page, and the error tells the person to use "Forgot password".
- **Upgrade from customized:** `APPSMITH_SIGNUP_DISABLED` and the
allowed-domain settings still apply to new accounts only. With signup
disabled, no mail, and no single sign-on, an invited account cannot be
activated until one of them is configured.
- **Rollback:** No data changes. Rolling back removes the activation
requirement.

Release note draft: "Form signup creates new accounts only. An invited
person activates the account with single sign-on or with the emailed
password reset link. Configure outbound email or single sign-on before
you invite people who do not have an account."

### CE/EE sync

Validated in EE PR appsmithorg/appsmith-ee#10648. The hourly sync
carries this change into EE. A simulated merge of this branch into EE
`release` has no conflicts.

### Merge timing

CE-first: this PR merges, and the hourly sync carries it into EE.

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/44399745006>
> Commit: 7ee958e
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=44399745006&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 18 Nov 2026 22:06:09 UTC
<!-- end of auto-generated comment: Cypress test results  -->

## Communication
Should the DevRel and Marketing teams inform users about this change?
- [x] Yes
- [ ] No

## Follow-ups

- A link an administrator can copy to activate a pending invitation when
mail is off.
- `UserServiceCEImpl.signupIfAllowed` matches configured admin emails
case-sensitively; align it with the new helper.
Problem: RTS registers a git maintenance route that nothing in the
product calls.

The fix: Remove the route, its controller, service and request type, and
the `simple-git` dependency that only this route used.

## Description

- `app/client/packages/rts/src/ce/server.ts` no longer imports or mounts
the git router.
- `simple-git` leaves the RTS manifest. The `simple-git` and
`@simple-git/argv-parser` resolutions leave the root client manifest
because nothing else uses them. The lockfile drops only those entries.
- New test `src/__tests__/routeSurface.test.ts` checks two things: the
git route path answers 404, and the health check still answers 200.

Advisory:
[GHSA-j5m9-g52c-9p9w](https://github.com/appsmithorg/appsmith/security/advisories/GHSA-j5m9-g52c-9p9w)

Linear: https://linear.app/appsmith/issue/APP-15898

### Reviewer notes

- Start with `src/ce/server.ts`. The rest of the diff is deletion.
- The last caller of this route went away with `refactor(git): remove
GitExecutor abstraction (#42010)`. Searching `release` for the route
path, the request type, the service and the router finds no reference
outside the deleted files.
- Places checked for a remaining user of the route or the dependency:
the Java `RTSCallerCEImpl` and its users (`DSLMigrationUtils`,
`AstServiceCEImpl`, `InstanceConfigHelperCEImpl`),
`deploy/docker/fs/opt/appsmith/run-java.sh`, and every `package.json`
under `app/client`. None uses them.
- The test sends `OPTIONS`. Express answers it from the route table
without calling a handler, so the test checks route registration only.
- Local results: the new test fails before the change and passes after
it. RTS unit suite: 10 suites, 108 tests pass. RTS lint and build pass.
`yarn install --immutable` passes with the edited lockfile.

### Impact on existing instances

- Fresh install: none.
- Upgrade from default: none. No default, environment variable,
persisted data or container topology changes.
- Upgrade from customized: an external client that calls this
undocumented route receives 404.
- Rollback: restores the route and the dependency. No data to reverse.

### CE/EE sync

Validated in EE PR appsmithorg/appsmith-ee#10602. The route file, both
package manifests and the lockfile differ between CE and EE, so the sync
may need conflict resolution in those files.

### Merge timing

This PR merges first. The EE PR closes unmerged and the sync carries
this change into EE.

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/44208597885>
> Commit: 6db3e4f
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=44208597885&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 18 Nov 2026 01:13:18 UTC
<!-- end of auto-generated comment: Cypress test results  -->

## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No

## Follow-ups

None.
@appsmith-smithes
appsmith-smithes Bot requested a review from a team as a code owner November 20, 2026 05:32
@appsmith-smithes appsmith-smithes Bot added the hacktron-exclude Skip Hacktron security scan for this PR label Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@hacktron-app hacktron-app Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 1 file

Severity Count
MEDIUM 1

View full scan results

Comment on lines +194 to +205
return CANCEL_TIMER.schedule(
() -> CANCEL_THREADS.start(() -> {
try {
if (!statement.isClosed()) {
statement.cancel();
}
} catch (SQLException e) {
// The statement finished or was closed meanwhile. Nothing is left to cancel.
}
}),
delayNanos,
TimeUnit.NANOSECONDS);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

MEDIUM AIP-FD-39: MSSQL deadline cancellation races pooled connection reuse

MssqlExecuteUtils.cancelAtDeadline (MssqlExecuteUtils.java:190-205) starts statement.cancel() on a separate virtual thread, but its returned future represents only the scheduled wrapper. When the deadline fires, cancel(false) in the finally block (MssqlPlugin.java:334-347) does not wait for that virtual thread before closeConnectionPostExecution closes the statement and returns the connection to Hikari. An authenticated user who can execute an MSSQL action can repeatedly reach this deadline path. A cancellation can then continue while the pooled connection is reused by another action, causing cancellation errors or availability failures for subsequent users. The isClosed() check is not synchronized with statement.cancel() or cleanup.

Steps to Reproduce
  1. Give an authenticated user permission to execute an MSSQL action backed by a Hikari connection pool. Configure the action with a finite timeout such as the 3000 ms timeout used by the MSSQL timeout tests.

  2. Use an action whose JDBC execution or later-result read remains active past that deadline. The action must reach the cancelAtDeadline call in MssqlPlugin.executeCommon.

  3. Arrange for the deadline callback to enter the virtual-thread cancellation worker while statement.cancel() remains in progress. The callback first checks statement.isClosed() and then calls statement.cancel() without holding a cleanup lock.

  4. Allow the JDBC call to return and inspect the finally path. cancelAtDeadline.cancel(false) does not wait for the already-started worker, and closeConnectionPostExecution closes the statement and calls connection.close() to return the connection to Hikari.

  5. Execute another action against the same datasource before the cancellation worker completes. The observable condition is that the second action can borrow the pooled connection while the first execution's cancellation worker still operates on its statement. This is the cross-execution lifetime overlap that requires the cancellation worker to be joined or the connection to be evicted before reuse.

Fix with AI

Open in Cursor Open in Claude

A security vulnerability was found by Hacktron.

File: app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/utils/MssqlExecuteUtils.java
Lines: 194-205
Severity: medium

Vulnerability: MSSQL deadline cancellation races pooled connection reuse

Description:
`MssqlExecuteUtils.cancelAtDeadline` ([MssqlExecuteUtils.java:190-205](./appsmith/app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/utils/MssqlExecuteUtils.java:190)) starts `statement.cancel()` on a separate virtual thread, but its returned future represents only the scheduled wrapper. When the deadline fires, `cancel(false)` in the `finally` block ([MssqlPlugin.java:334-347](./appsmith/app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/MssqlPlugin.java:334)) does not wait for that virtual thread before `closeConnectionPostExecution` closes the statement and returns the connection to Hikari. An authenticated user who can execute an MSSQL action can repeatedly reach this deadline path. A cancellation can then continue while the pooled connection is reused by another action, causing cancellation errors or availability failures for subsequent users. The `isClosed()` check is not synchronized with `statement.cancel()` or cleanup.

Proof of Concept:
**Steps to Reproduce**

1. Give an authenticated user permission to execute an MSSQL action backed by a Hikari connection pool. Configure the action with a finite timeout such as the 3000 ms timeout used by the MSSQL timeout tests.

2. Use an action whose JDBC execution or later-result read remains active past that deadline. The action must reach the `cancelAtDeadline` call in `MssqlPlugin.executeCommon`.

3. Arrange for the deadline callback to enter the virtual-thread cancellation worker while `statement.cancel()` remains in progress. The callback first checks `statement.isClosed()` and then calls `statement.cancel()` without holding a cleanup lock.

4. Allow the JDBC call to return and inspect the `finally` path. `cancelAtDeadline.cancel(false)` does not wait for the already-started worker, and `closeConnectionPostExecution` closes the statement and calls `connection.close()` to return the connection to Hikari.

5. Execute another action against the same datasource before the cancellation worker completes. The observable condition is that the second action can borrow the pooled connection while the first execution's cancellation worker still operates on its statement. This is the cross-execution lifetime overlap that requires the cancellation worker to be joined or the connection to be evicted before reuse.

Affected Code:
return CANCEL_TIMER.schedule(
        () -> CANCEL_THREADS.start(() -> {
            try {
                if (!statement.isClosed()) {
                    statement.cancel();
                }
            } catch (SQLException e) {
                // The statement finished or was closed meanwhile. Nothing is left to cancel.
            }
        }),
        delayNanos,
        TimeUnit.NANOSECONDS);

Acceptance criteria:
- Acceptance is defined by the **actual reported behavior**, not by tests passing.
- Reproduce the issue, or narrow the exact code path that produces it, *before* changing code. State what you confirmed.
- Fix the underlying cause. Mitigations that paper over the reported behavior do not count as a fix.
- Add a regression test that fails on the unpatched code and passes on the fix. If a regression test is genuinely impractical (e.g. race condition, infra-level issue), say so and explain why.
- Existing tests passing is **not** the bar. Do not declare done on tests-pass theatre.

Only change what is necessary to fix this vulnerability. Do not refactor adjacent code or modify unrelated files.

Triage: Reply !fp <reason> (false positive), !valid (confirmed), !accepted_risk <reason>, or !fixed (resolved). Any other reply is saved as a triage note.
Reason is optional but improves future scans — e.g. !fp internal endpoint, not user-facing.

View finding in Hacktron

@appsmith-promotion
appsmith-promotion Bot merged commit a1f1a4d into master Nov 20, 2026
186 of 190 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktron-exclude Skip Hacktron security scan for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants