Skip to content

Commit

Permalink
Merge pull request FlowiseAI#1372 from FlowiseAI/bugfix/XSS-array-query
Browse files Browse the repository at this point in the history
Bugfix/Sanitized &amp
  • Loading branch information
HenryHengZJ authored Dec 12, 2023
2 parents cff0618 + 3e6e0f9 commit 65c4ecf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@ export class App {

// Get component credential via name
this.app.get('/api/v1/components-credentials/:name', (req: Request, res: Response) => {
if (!req.params.name.includes('&')) {
if (!req.params.name.includes('&')) {
if (Object.prototype.hasOwnProperty.call(this.nodesPool.componentCredentials, req.params.name)) {
return res.json(this.nodesPool.componentCredentials[req.params.name])
} else {
throw new Error(`Credential ${req.params.name} not found`)
}
} else {
const returnResponse = []
for (const name of req.params.name.split('&')) {
for (const name of req.params.name.split('&')) {
if (Object.prototype.hasOwnProperty.call(this.nodesPool.componentCredentials, name)) {
returnResponse.push(this.nodesPool.componentCredentials[name])
} else {
Expand Down

0 comments on commit 65c4ecf

Please sign in to comment.