Skip to content

Commit

Permalink
#3894 fix CodeQL issue
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlaStarla committed Mar 25, 2024
1 parent 2bb38cc commit 0f1627d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,14 @@ export class KetSerializer implements Serializer<Struct> {
let offset;
parsedFileContent.root.nodes.forEach((node, index) => {
const nodeDefinition = parsedFileContent[node.$ref] as IKetMonomerNode;
if (
!nodeDefinition &&
(nodeDefinition === '__proto__' ||
nodeDefinition === 'constructor' ||
nodeDefinition === 'prototype')
) {
return;
}
nodeDefinition.position = switchIntoChemistryCoordSystem(

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
user controlled input
.
new Vec2(nodeDefinition.position),
);
Expand Down

0 comments on commit 0f1627d

Please sign in to comment.