-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[Fix] add black key for switch task #15680
Conversation
".", | ||
"()", | ||
"[", | ||
"]", |
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.
can we get the final exec command in user input? such as we can convert below code
var a = Java.type("ja" + "va.lang.Runtime");
var b = a.getRuntime();
b.exec(${cmd})
to
var a = Java.type("ja" + "va.lang.Runtime");
var b = a.getRuntime();
Java.type("ja" + "va.lang.Runtime").getRuntime().exec(${cmd})
If we can do it, I think that would be easier to check
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.
It's hard to convert because the code are executed in js engine.
Is it hard to cover all types inject via block list, I think |
You mean whitelist? |
If attackers try to inject code, I think it is hardly possible for them to bypass using |
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.
LGTM
Maybe it's better to add the black keys in common config? WDYT? @zhongjiajie @EricGao888 |
Can they use encode and decode libs to bypass? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #15680 +/- ##
=========================================
Coverage 39.09% 39.09%
Complexity 4851 4851
=========================================
Files 1316 1316
Lines 44963 44963
Branches 4810 4810
=========================================
Hits 17579 17579
Misses 25485 25485
Partials 1899 1899 ☔ View full report in Codecov by Sentry. |
I think current solution in this PR (hard-coded black key) is good enough. If we make the black keys configurable, we also need to add comments above the config to warn users of this risk. |
OK |
Quality Gate passedIssues Measures |
Purpose of the pull request
Brief change log
SwitchTaskUtils
Verify this pull request