New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swift: Unsafe JS Eval Query #11001
base: main
Are you sure you want to change the base?
Swift: Unsafe JS Eval Query #11001
Conversation
Also allow clangd to use the generated `swift/compile_commands.json` for intellisense in the codeql repository, via `.vscode/settings.json`. The `-arch=x86_64` from `swift/rules.bzl` turns out to be unnecessary, even on Arm-based Macs.
| "--header-insertion=never", | ||
| "--compile-commands-dir=${workspaceFolder}/swift", | ||
| "--query-driver=**" | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not all that familiar with this stuff (the first commit of this PR).
|
|
||
| /** | ||
| * A source of untrusted, user-controlled data. | ||
| * TODO: Extend to more (non-remote) sources in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I think this is a good example of a query where I would be nervous even of local user input being evaluated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created github/codeql-c-team#1318 to address this as follow-up.
| ce.getStaticTarget() = getFunctionWithQualifiedName("JSEvaluateScript(_:_:_:_:_:_:)") | ||
| ).getArgument(1).getExpr() = this.asExpr() | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great coverage with all of these sinks!
| // - parentDecl = memberDecl.getDeclaringDecl() <=> parentDecl.getAMember() = memberDecl | ||
| IterableDeclContext getDeclaringDeclOf(Decl member) { result.getAMember() = member } | ||
|
|
||
| MethodDecl getMethodWithQualifiedName(string className, string methodName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
No description provided.