Skip to content

Commit 3af6c74

Browse files
committed
cve fixes
Signed-off-by: wwanarif <[email protected]>
1 parent 34da16b commit 3af6c74

File tree

67 files changed

+478
-347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+478
-347
lines changed

.github/workflows/manual-docker-scan.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
ignore-unfixed: true
7070
vuln-type: 'os,library'
7171
severity: 'CRITICAL,HIGH'
72+
# timeout: '10m0s'
7273

7374
- name: Cleanup
7475
if: always()

app-backend/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
2626
WORKDIR /home/user/GenAIComps
2727
RUN pip install --no-cache-dir --upgrade pip==24.3.1 setuptools==78.1.1 && \
2828
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \
29-
pip install --no-cache-dir --upgrade mcp==1.10.0 pillow==11.3.0
29+
pip install --no-cache-dir --upgrade mcp==1.23.0 pillow==11.3.0 \
30+
langchain-core==0.3.80 urllib3==2.6.0 starlette==0.49.1
3031

3132
COPY ./templates/microservices/* /home/user/templates/microservices/
3233
COPY ./megaservice.py /home/user/megaservice.py
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
fastapi==0.115.4
1+
fastapi==0.121.0
22
uvicorn==0.30.6
33
kubernetes==30.1.0
44
requests==2.32.3
5-
urllib3==2.0.0
5+
urllib3==2.6.0
66
pydantic==1.10.18
7-
starlette==0.41.2
7+
starlette==0.49.1
88
websockets==10.3
99
clickhouse-driver==0.2.9
1010
paramiko==3.5.1
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pytest==8.3.3
2-
fastapi==0.115.0
2+
fastapi==0.121.0
33
httpx==0.27.2
44
kubernetes==30.1.0
55
pydantic==1.10.18
6-
urllib3==2.0.0
6+
urllib3==2.6.0

studio-frontend/Dockerfile

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM node:20-alpine
1+
# Build stage
2+
FROM node:20-alpine AS builder
23

34
# Accept proxy build arguments
45
ARG http_proxy
@@ -10,37 +11,62 @@ ENV http_proxy=${http_proxy}
1011
ENV https_proxy=${https_proxy}
1112
ENV no_proxy=${no_proxy}
1213

13-
# Install necessary packages
14+
# Install build dependencies
1415
RUN apk update && apk upgrade && \
1516
apk add --no-cache gcompat python3 make g++ git \
16-
# Needed for pdfjs-dist
17-
build-base cairo-dev pango-dev \
18-
# Install Chromium
19-
chromium && \
20-
# Install PNPM globally
17+
build-base cairo-dev pango-dev && \
2118
npm install -g pnpm@9
2219

23-
# Debug step to verify git installation
24-
RUN git --version
20+
ENV NODE_OPTIONS=--max-old-space-size=8192
21+
22+
WORKDIR /usr/src
23+
24+
# Copy package files first for better layer caching
25+
COPY package.json pnpm-workspace.yaml turbo.json ./
26+
COPY packages/server/package.json ./packages/server/
27+
COPY packages/ui/package.json ./packages/ui/
28+
29+
# Install dependencies
30+
RUN pnpm install
31+
32+
# Copy source code
33+
COPY . .
34+
35+
# Build the app and clean up
36+
RUN pnpm build && \
37+
# Prune to production dependencies only
38+
pnpm prune --prod && \
39+
rm -rf node_modules/.cache && \
40+
rm -rf packages/*/node_modules/.cache
41+
42+
# Production stage
43+
FROM node:20-alpine
44+
45+
# Accept proxy build arguments
46+
ARG http_proxy
47+
ARG https_proxy
48+
ARG no_proxy
49+
50+
ENV http_proxy=${http_proxy}
51+
ENV https_proxy=${https_proxy}
52+
ENV no_proxy=${no_proxy}
53+
54+
# Install only runtime dependencies with patched npm
55+
RUN apk update && apk upgrade && \
56+
apk add --no-cache gcompat chromium && \
57+
npm install -g npm@latest pnpm@latest && \
58+
rm -rf /var/cache/apk/*
2559

2660
ENV PUPPETEER_SKIP_DOWNLOAD=true
2761
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
2862
ENV NODE_OPTIONS=--max-old-space-size=8192
2963

3064
WORKDIR /usr/src
3165

32-
# Copy app source
33-
COPY . .
34-
35-
# Install dependencies and build the app
36-
RUN pnpm config set store-dir .pnpm-store && \
37-
pnpm install && \
38-
pnpm update [email protected] && \
39-
pnpm build && \
40-
pnpm remove esbuild && \
41-
rm -rf .pnpm-store && \
42-
rm -rf /root/.local/share/pnpm && \
43-
pnpm prune --prod
66+
# Copy only necessary files from builder
67+
COPY --from=builder /usr/src/package.json /usr/src/pnpm-workspace.yaml ./
68+
COPY --from=builder /usr/src/packages ./packages
69+
COPY --from=builder /usr/src/node_modules ./node_modules
4470

4571
EXPOSE 3000
4672

studio-frontend/package.json

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
{
22
"name": "flowise",
3-
"version": "2.1.4",
3+
"version": "3.0.10",
44
"private": true,
55
"homepage": "https://flowiseai.com",
66
"workspaces": [
7-
"packages/*",
8-
"flowise",
9-
"ui"
7+
"packages/*"
108
],
119
"scripts": {
1210
"build": "turbo run build",
1311
"build-force": "pnpm clean && turbo run build --force",
14-
"dev": "turbo run dev --parallel",
12+
"dev": "turbo run dev --parallel --no-cache",
1513
"start": "run-script-os",
1614
"start:windows": "cd packages/server/bin && run start",
1715
"start:default": "cd packages/server/bin && ./run start",
@@ -32,7 +30,6 @@
3230
"@babel/preset-typescript": "7.18.6",
3331
"@types/express": "^4.17.13",
3432
"@typescript-eslint/typescript-estree": "^7.13.1",
35-
"esbuild": ">=0.25.0",
3633
"eslint": "^8.24.0",
3734
"eslint-config-prettier": "^8.3.0",
3835
"eslint-config-react-app": "^7.0.1",
@@ -42,14 +39,17 @@
4239
"eslint-plugin-react": "^7.26.1",
4340
"eslint-plugin-react-hooks": "^4.6.0",
4441
"eslint-plugin-unused-imports": "^2.0.0",
42+
"cross-spawn": "^7.0.6",
43+
"glob": "^10.5.0",
44+
"tar-fs": "^3.1.1",
4545
"husky": "^8.0.1",
4646
"kill-port": "^2.0.1",
4747
"lint-staged": "^13.0.3",
4848
"prettier": "^2.7.1",
4949
"pretty-quick": "^3.1.3",
5050
"rimraf": "^3.0.2",
5151
"run-script-os": "^1.1.6",
52-
"turbo": "latest",
52+
"turbo": "^2.3.3",
5353
"typescript": "^5.4.5"
5454
},
5555
"pnpm": {
@@ -58,8 +58,30 @@
5858
"sqlite3"
5959
],
6060
"overrides": {
61-
"set-value": "^3.0.3",
62-
"form-data": "4.0.4"
61+
"@modelcontextprotocol/sdk": ">=1.24.0",
62+
"axios": "1.12.0",
63+
"body-parser": "2.0.2",
64+
"braces": "3.0.3",
65+
"cross-spawn": "7.0.6",
66+
"esbuild": "0.27.1",
67+
"form-data": "4.0.4",
68+
"glob": "10.5.0",
69+
"glob-parent": "6.0.2",
70+
"http-proxy-middleware": "3.0.3",
71+
"json5": "2.2.3",
72+
"nth-check": "2.1.1",
73+
"path-to-regexp": "0.1.12",
74+
"prismjs": "1.29.0",
75+
"rollup": "4.45.0",
76+
"semver": "7.7.1",
77+
"set-value": "4.1.0",
78+
"solid-js": "1.9.7",
79+
"tar-fs": ">=3.1.1",
80+
"unset-value": "2.0.1",
81+
"webpack-dev-middleware": "7.4.2",
82+
"ws": "8.18.3",
83+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
84+
"zod": "^3.25.0"
6385
},
6486
"peerDependencyRules": {
6587
"ignoreMissing": [],
@@ -71,22 +93,12 @@
7193
"pnpm": ">=9"
7294
},
7395
"resolutions": {
96+
"@google/generative-ai": "^0.24.0",
97+
"@grpc/grpc-js": "^1.10.10",
98+
"@langchain/core": "0.3.61",
7499
"@qdrant/openapi-typescript-fetch": "1.2.6",
75-
"@google/generative-ai": "^0.15.0",
76-
"openai": "4.57.3",
77-
"@langchain/core": "0.2.18",
78-
"axios": "1.8.2",
79-
"nth-check": "2.0.1",
80-
"pdfjs-dist": "4.2.67",
81-
"prismjs": "1.27.0",
82-
"semver": "7.5.2",
83-
"ws": "8.17.1",
84-
"esbuild": ">=0.25.0",
85-
"cross-spawn": ">=7.0.5",
86-
"solid-js": ">=1.9.4",
87-
"tar-fs": ">=3.0.8",
88-
"form-data": "4.0.4",
89-
"zod": ">=3.23.0"
100+
"openai": "4.96.0",
101+
"protobufjs": "7.4.0"
90102
},
91103
"eslintIgnore": [
92104
"**/dist",

studio-frontend/packages/server/package.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flowise",
3-
"version": "2.1.4",
3+
"version": "3.0.10",
44
"description": "Flowiseai Server",
55
"main": "dist/index",
66
"types": "dist/index.d.ts",
@@ -26,7 +26,7 @@
2626
"nuke": "rimraf dist node_modules .turbo",
2727
"start:windows": "cd bin && run start",
2828
"start:default": "cd bin && ./run start",
29-
"dev": "tsc-watch --noClear -p ./tsconfig.json --onSuccess \"pnpm start\"",
29+
"dev": "nodemon",
3030
"oclif-dev": "run-script-os",
3131
"oclif-dev:windows": "cd bin && dev start",
3232
"oclif-dev:default": "cd bin && ./dev start",
@@ -35,13 +35,14 @@
3535
"typeorm": "typeorm-ts-node-commonjs",
3636
"typeorm:migration-generate": "pnpm typeorm migration:generate -d ./src/utils/typeormDataSource.ts",
3737
"typeorm:migration-run": "pnpm typeorm migration:run -d ./src/utils/typeormDataSource.ts",
38+
"typeorm:migration-revert": "pnpm typeorm migration:revert -d ./src/utils/typeormDataSource.ts",
3839
"watch": "tsc --watch",
3940
"version": "oclif readme && git add README.md",
4041
"cypress:open": "cypress open",
4142
"cypress:run": "cypress run",
4243
"e2e": "start-server-and-test dev http://localhost:3000 cypress:run",
4344
"cypress:ci": "START_SERVER_AND_TEST_INSECURE=1 start-server-and-test start https-get://localhost:3000 cypress:run",
44-
"test": "jest"
45+
"test": "jest --runInBand --detectOpenHandles --forceExit"
4546
},
4647
"keywords": [],
4748
"homepage": "https://flowiseai.com",
@@ -54,30 +55,32 @@
5455
},
5556
"license": "SEE LICENSE IN LICENSE.md",
5657
"dependencies": {
57-
"@oclif/core": "^1.13.10",
58-
"@types/lodash": "^4.14.202",
58+
"@oclif/core": "4.0.7",
59+
"@types/lodash": "^4.17.20",
5960
"@types/uuid": "^9.0.7",
6061
"async-mutex": "^0.4.0",
61-
"axios": "^1.8.2",
62+
"axios": "1.12.0",
6263
"content-disposition": "0.5.4",
6364
"cors": "^2.8.5",
6465
"crypto-js": "^4.1.1",
6566
"dotenv": "^16.0.0",
6667
"express": "^4.17.3",
6768
"express-basic-auth": "^1.2.1",
6869
"express-rate-limit": "^6.9.0",
69-
"flowise-components": "^2.1.4",
70+
"flowise-components": "^3.0.8",
7071
"flowise-ui": "workspace:^",
7172
"http-errors": "^2.0.0",
7273
"http-status-codes": "^2.3.0",
74+
"@langchain/core": "^0.2.0",
75+
"@langchain/langgraph": "^0.0.15",
7376
"langchainhub": "^0.0.11",
7477
"lodash": "^4.17.21",
7578
"moment": "^2.29.3",
7679
"moment-timezone": "^0.5.34",
7780
"multer": "^1.4.5-lts.1",
78-
"mysql2": "^3.9.2",
81+
"mysql2": "^3.11.3",
7982
"form-data": "^4.0.0",
80-
"openai": "^4.57.3",
83+
"openai": "^4.96.0",
8184
"pg": "^8.11.1",
8285
"posthog-node": "^3.5.0",
8386
"reflect-metadata": "^0.1.13",
@@ -93,13 +96,14 @@
9396
"devDependencies": {
9497
"@types/content-disposition": "0.5.8",
9598
"@types/cors": "^2.8.12",
99+
"@types/express": "^4.17.17",
96100
"@types/crypto-js": "^4.1.1",
97101
"@types/multer": "^1.4.7",
98102
"@types/sanitize-html": "^2.9.5",
99103
"concurrently": "^7.1.0",
100104
"cypress": "^13.13.0",
101105
"nodemon": "^2.0.22",
102-
"oclif": "^3",
106+
"oclif": "^4.20.5",
103107
"rimraf": "^5.0.5",
104108
"run-script-os": "^1.1.6",
105109
"shx": "^0.3.3",

studio-frontend/packages/server/src/NodesPool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class NodesPool {
108108
private async getFiles(dir: string): Promise<string[]> {
109109
const dirents = await promises.readdir(dir, { withFileTypes: true })
110110
const files = await Promise.all(
111-
dirents.map((dirent: Dirent) => {
111+
dirents.map((dirent) => {
112112
const res = path.resolve(dir, dirent.name)
113113
return dirent.isDirectory() ? this.getFiles(res) : res
114114
})

studio-frontend/packages/server/src/commands/start.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Command, Flags } from '@oclif/core'
1+
import { Command, Flags, Args } from '@oclif/core'
22
import path from 'path'
33
import * as Server from '../index'
44
import * as DataSource from '../DataSource'
@@ -14,7 +14,7 @@ enum EXIT_CODE {
1414
let processExitCode = EXIT_CODE.SUCCESS
1515

1616
export default class Start extends Command {
17-
static args = []
17+
static args = {}
1818
static flags = {
1919
FLOWISE_USERNAME: Flags.string(),
2020
FLOWISE_PASSWORD: Flags.string(),

studio-frontend/packages/server/src/controllers/get-upload-file/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import { streamStorageFile } from 'flowise-components'
55
import { StatusCodes } from 'http-status-codes'
66
import { InternalFlowiseError } from '../../errors/internalFlowiseError'
77

8+
interface AuthenticatedRequest extends Request {
9+
user?: {
10+
activeOrganizationId?: string
11+
}
12+
}
13+
814
const streamUploadedFile = async (req: Request, res: Response, next: NextFunction) => {
915
try {
1016
if (!req.query.chatflowId || !req.query.chatId || !req.query.fileName) {
@@ -13,8 +19,9 @@ const streamUploadedFile = async (req: Request, res: Response, next: NextFunctio
1319
const chatflowId = req.query.chatflowId as string
1420
const chatId = req.query.chatId as string
1521
const fileName = req.query.fileName as string
22+
const orgId = (req as AuthenticatedRequest).user?.activeOrganizationId || ''
1623
res.setHeader('Content-Disposition', contentDisposition(fileName))
17-
const fileStream = await streamStorageFile(chatflowId, chatId, fileName)
24+
const fileStream = await streamStorageFile(chatflowId, chatId, fileName, orgId)
1825

1926
if (!fileStream) throw new InternalFlowiseError(StatusCodes.INTERNAL_SERVER_ERROR, `Error: streamStorageFile`)
2027

0 commit comments

Comments
 (0)