Skip to content

Commit

Permalink
fix: 修正编译器 hat param 未 sanitize 导致的任意执行漏洞
Browse files Browse the repository at this point in the history
Signed-off-by: FurryR <[email protected]>
  • Loading branch information
FurryR authored and sylarhcn committed Sep 24, 2024
1 parent d6175e3 commit c929f2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/jsgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ class JSGenerator {
return new TypedInput(`${JSON.stringify(node.value)}`, TYPE_UNKNOWN);

case 'args.ccw_hat_parameter':
return new TypedInput(`(thread.hatParam ? thread.hatParam['${node.index}']: null)`, TYPE_UNKNOWN);
return new TypedInput(`(thread.hatParam ? thread.hatParam["${sanitize(node.index)}"]: null)`, TYPE_UNKNOWN);

case 'addons.call':
return new TypedInput(`(${this.descendAddonCall(node)})`, TYPE_UNKNOWN);
Expand Down

0 comments on commit c929f2d

Please sign in to comment.