Skip to content

Commit 69a28e2

Browse files
authored
fix: check user input uuid (#6446)
1 parent 3e76e87 commit 69a28e2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/services/api/src/modules/schema/providers/schema-manager.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
} from '../../../shared/entities';
2424
import { HiveError } from '../../../shared/errors';
2525
import { atomic, cache, stringifySelector } from '../../../shared/helpers';
26+
import { isUUID } from '../../../shared/is-uuid';
2627
import { parseGraphQLSource } from '../../../shared/schema';
2728
import { Session } from '../../auth/lib/authz';
2829
import { GitHubIntegrationManager } from '../../integrations/providers/github-integration-manager';
@@ -685,6 +686,16 @@ export class SchemaManager {
685686
schemaCheckId,
686687
);
687688

689+
if (isUUID(schemaCheckId) === false) {
690+
this.logger.debug(
691+
'Invalid ID provided (targetId=%s, schemaCheckId=%s)',
692+
target.id,
693+
schemaCheckId,
694+
);
695+
696+
return null;
697+
}
698+
688699
const schemaCheck = await this.storage.findSchemaCheck({
689700
targetId: target.id,
690701
schemaCheckId,

0 commit comments

Comments
 (0)