Skip to content

Dev - #9

Merged
dmitryplyaskin merged 15 commits into
mainfrom
dev
Jul 30, 2026
Merged

Dev#9
dmitryplyaskin merged 15 commits into
mainfrom
dev

Conversation

@dmitryplyaskin

Copy link
Copy Markdown
Owner

No description provided.

@dmitryplyaskin
dmitryplyaskin merged commit 6f7593e into main Jul 30, 2026
4 checks passed

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4a61c5ea9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +38 to +40
const body = scanBodySchema.parse(req.body);
try {
return { data: await scanSillyTavernImportRoot(body.rootPath) };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restrict server-side imports to trusted users and roots

In public multi-user deployments, any authenticated user can submit an arbitrary server path to this endpoint; the scanner enumerates recognized files under that root, and the companion import endpoint copies character, persona, world-info, and chat contents into the caller's account. A normal user who knows another user's SillyTavern installation path can therefore import that user's data. Restrict these endpoints to administrators/local mode and validate the root against an explicit allowlist.

AGENTS.md reference: AGENTS.md:L125-L125

Useful? React with 👍 / 👎.

Comment on lines +3 to +6
const DEFAULT_CORS_ORIGINS = [
"http://localhost:5173",
"http://127.0.0.1:5173",
] as const;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Allow the built frontend's same origin by default

When the production frontend is built into server/public and served by Express at http://localhost:5000, same-origin mutation requests carry an Origin of http://localhost:5000, but the default allowlist contains only the Vite development origins on port 5173. Consequently rejectDisallowedOrigin returns 403 before routing every POST/PATCH/DELETE in the default built deployment. Include the backend's local origins or accept an origin that matches the request host.

Useful? React with 👍 / 👎.

Comment on lines +438 to +442
data: await resetUserPassword({
userId: params.id,
...body,
config,
}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent administrative self-password resets from stranding the UI

When an administrator resets their own password from the Users tab, this call revokes every session for the target, including the session authenticating the request, but returns only a user DTO and leaves the frontend marked authenticated. The model then immediately reloads the user list with the revoked cookie, receives 401, and leaves the application in a stale authenticated state even though the reset succeeded. Reject self-targeting here, route it through the own-password flow that issues a replacement session, or explicitly transition the client to logged out.

Useful? React with 👍 / 👎.

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