Compare commits

..

2 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] ee8fb68839 Fix auth bypass: normalize URL path to lowercase before JWT/auth checks
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2026-03-01 09:39:35 +00:00
copilot-swe-agent[bot] eaafaf3dfc Initial plan 2026-03-01 09:34:27 +00:00
5 changed files with 11 additions and 7 deletions
-4
View File
@@ -28,7 +28,3 @@ __pycache__
/shell/preload/notify.*
/shell/preload/*-notify.json
/shell/preload/__ql_notify__.*
# Test files
test-*.cjs
test-*.mjs
+8
View File
@@ -22,6 +22,14 @@ export default ({ app }: { app: Application }) => {
app.use(rewrite(`${config.baseUrl}/*`, '/$1'));
}
// Normalize URL path to lowercase to prevent authentication bypass via mixed-case paths
// e.g. /API/system/command-run should not bypass JWT checks designed for /api/...
// The regex only matches the path portion (stops at ? or #), preserving query strings.
app.use((req: Request, res: Response, next: NextFunction) => {
req.url = req.url.replace(/^[^?#]*/, (p) => p.toLowerCase());
next();
});
app.get(`${config.api.prefix}/env.js`, serveEnv);
app.use(`${config.api.prefix}/static`, express.static(config.uploadPath));
+1 -1
View File
@@ -3,7 +3,7 @@ import config from '@/utils/config';
import { request } from '@/utils/http';
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
import { Button, Form, Input, Modal, Select, Space, message } from 'antd';
import { CronExpressionParser } from 'cron-parser';
import CronExpressionParser from 'cron-parser';
import { useEffect, useState } from 'react';
import intl from 'react-intl-universal';
import { getScheduleType, scheduleTypeMap } from './const';
+1 -1
View File
@@ -12,7 +12,7 @@ import {
} from 'antd';
import { request } from '@/utils/http';
import config from '@/utils/config';
import { CronExpressionParser } from 'cron-parser';
import CronExpressionParser from 'cron-parser';
import isNil from 'lodash/isNil';
const { Option } = Select;
+1 -1
View File
@@ -1,6 +1,6 @@
import intl from 'react-intl-universal';
import { LANG_MAP, LOG_END_SYMBOL } from './const';
import { CronExpressionParser } from 'cron-parser';
import CronExpressionParser from 'cron-parser';
import { ICrontab } from '@/pages/crontab/type';
export default function browserType() {