-
Notifications
You must be signed in to change notification settings - Fork 33
Fixes for LOC-6730 & 6729 #98
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,8 @@ jobs: | |
|
|
||
| container: | ||
| # A Docker image with Semgrep installed. Do not change this. | ||
| image: returntocorp/semgrep | ||
| # Pinned by digest (LOC-6730 / INF-002) — tag-mutation is a supply-chain vector. | ||
| image: returntocorp/semgrep@sha256:9349edbadf90c3f3c0c3f55867625354e89680e6fa10d9034042af52fdb0e0d0 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pin works — verified the digest Two improvements worth considering:
Question: is a
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope |
||
|
|
||
| # Skip any PR created by dependabot to avoid permission issues: | ||
| if: (github.actor != 'dependabot[bot]') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,7 +159,7 @@ private void makeCommand(Map<String, String> options, String opCode) { | |
| if (IGNORE_KEYS.contains(parameter)) { | ||
| continue; | ||
| } | ||
| if (avoidValueParameters.get(parameter) != null && opt.getValue().trim().toLowerCase() != "false") { | ||
| if (avoidValueParameters.get(parameter) != null && !"false".equals(opt.getValue().trim().toLowerCase())) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fix is correct (
That's the intended fix. But anyone who was passing More importantly: the PR ships this behavior change with no test coverage. There appears to be no test asserting:
Without these, a future refactor of Suggested fix: add ~3 unit tests on
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not required |
||
| command.add(avoidValueParameters.get(parameter)); | ||
| } else { | ||
| if (parameters.get(parameter) != null) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -214,7 +214,7 @@ private void fetchSourceUrl() throws LocalException { | |||||||||||||
| inputParams.put("auth_token", this.key); | ||||||||||||||
| if (fallbackEnabled) { | ||||||||||||||
| connection.setRequestProperty("X-Local-Fallback-Cloudflare", "true"); | ||||||||||||||
| inputParams.put("error_message", downloadFailureThrowable.getMessage()); | ||||||||||||||
| inputParams.put("error_message", downloadFailureThrowable.getClass().getName()); | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The ticket said "send error code, not raw Suggested alternatives (any of these is better):
Question: has the team that consumes
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. checked local-service code, this errorMessage is only sent to EDS.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adjacent — not about this line, but flagging since I have the whole The Python sibling PR (#61) just landed LOC-6717 (shell-injection via
Question: is there a sibling ticket for the "download to user-supplied path" case (
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not relevant |
||||||||||||||
| } | ||||||||||||||
| String jsonInputParams = inputParams.toString(); | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
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.
Anchoring here because this is the only INF- fix in the diff* — the actual concern is PR-wide.
PR title says "Fixes for LOC-6730 & 6729". After diffing
.travis.ymlandpom.xmlbetweenmasterand this PR head, both files are identical — i.e. INF-003/INF-004/INF-005 weren't touched. Sub-issue status:Local.java:152-153)command.add("--key"); command.add(options.get("key"));!= "false"reference comparisonwgetMaven, no checksummaven-compiler-plugin 2.3.2,maven-surefire-plugin 2.4.23 of 7 sub-issues. The two highest-CVSS items (INF-003 = 6.8, INF-002 = 6.3) include one still untouched. The PR body is empty, so on merge both tickets will look closed from the ticket-watcher's view.
Questions:
BROWSERSTACK_ACCESS_KEYenv-var support been confirmed?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.
The "not addressed" fixes marked above are not intended to be fixed, as this has been approved by the Security team.
https://browserstack.atlassian.net/browse/LOC-6729?focusedCommentId=2063323