mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 07:05:24 +00:00
fix: lock the desktop backend to the app's own origin (GHSA-frx8-qqgg-7j7g)
This commit is contained in:
1 parent
cd29e1d087
commit
ad3a18224f
3 files changed
+64
-5
No files matched your search
@@ -11,6 +11,7 @@ import { authLogger } from "../../utils/logger.js";
|
||||
import { AuthManager } from "../../utils/auth-manager.js";
|
||||
import { DatabaseSaveTrigger } from "../../utils/database-save-trigger.js";
|
||||
import { parseUserAgent } from "../../utils/user-agent-parser.js";
|
||||
import { isDesktopAppOrigin } from "../../utils/cors-config.js";
|
||||
import { deleteUserAndRelatedData } from "./delete-user-data.js";
|
||||
import {
|
||||
allowsDesktopAutoSession,
|
||||
@@ -744,7 +745,11 @@ router.get("/setup-required", async (req, res) => {
|
||||
*/
|
||||
router.post("/internal/auto-session", async (req, res) => {
|
||||
try {
|
||||
if (!allowsDesktopAutoSession() || !isLoopbackRequest(req)) {
|
||||
if (
|
||||
!allowsDesktopAutoSession() ||
|
||||
!isLoopbackRequest(req) ||
|
||||
!isDesktopAppOrigin(req.headers.origin)
|
||||
) {
|
||||
authLogger.warn(
|
||||
"Rejected non-loopback attempt to access auto-session endpoint",
|
||||
{ source: req.ip },
|
||||
|
||||
Reference in new issue
Block a user