From 5595a2eca7eb1fd60c536df5a90984678a120d35 Mon Sep 17 00:00:00 2001 From: Sruthi Chandran Date: Wed, 13 Mar 2019 22:55:13 +0530 Subject: [PATCH] New upstream version 11.8.2 --- CHANGELOG.md | 42 ++ VERSION | 2 +- .../behaviors/markdown/render_mermaid.js | 19 + .../mr_widget_options.vue | 2 +- .../stylesheets/pages/merge_requests.scss | 1 - app/controllers/concerns/milestone_actions.rb | 2 +- .../google_api/authorizations_controller.rb | 32 +- .../profiles/active_sessions_controller.rb | 11 +- .../autocomplete_sources_controller.rb | 2 + app/controllers/projects/commit_controller.rb | 6 +- .../projects/group_links_controller.rb | 5 +- app/finders/merge_requests_finder.rb | 9 +- app/graphql/types/project_type.rb | 2 - app/mailers/emails/issues.rb | 1 + app/models/active_session.rb | 6 +- app/models/clusters/platforms/kubernetes.rb | 2 +- app/models/concerns/issuable.rb | 11 + app/models/concerns/milestoneish.rb | 23 +- app/models/merge_request.rb | 9 +- app/models/merge_request_diff.rb | 2 + app/models/project.rb | 2 +- app/models/project_feature.rb | 15 +- .../project_services/prometheus_service.rb | 6 +- app/policies/group_policy.rb | 5 +- app/policies/project_policy.rb | 4 +- app/services/issuable_base_service.rb | 6 + app/services/issues/build_service.rb | 4 +- app/services/merge_requests/build_service.rb | 1 + .../projects/group_links/create_service.rb | 10 +- app/uploaders/file_mover.rb | 8 + app/validators/sha_validator.rb | 9 + app/views/notify/issue_moved_email.html.haml | 11 +- app/views/notify/issue_moved_email.text.erb | 4 + .../active_sessions/_active_session.html.haml | 6 - .../viewers/_dependency_manager.html.haml | 5 - .../shared/milestones/_milestone.html.haml | 2 +- app/views/shared/milestones/_tabs.html.haml | 6 +- config/routes/git_http.rb | 2 +- doc/administration/index.md | 2 +- doc/administration/merge_request_diffs.md | 33 +- doc/install/requirements.md | 2 +- doc/user/profile/active_sessions.md | 8 +- doc/user/profile/img/active_sessions_list.png | Bin 22266 -> 19360 bytes lib/api/commits.rb | 10 +- lib/api/entities.rb | 9 +- lib/api/environments.rb | 8 +- lib/api/helpers/notes_helpers.rb | 14 +- lib/api/helpers/runner.rb | 2 +- lib/api/projects.rb | 39 +- lib/api/release/links.rb | 2 + lib/constraints/project_url_constrainer.rb | 3 +- lib/gitlab/dependency_linker/base_linker.rb | 18 + .../dependency_linker/composer_json_linker.rb | 4 +- .../dependency_linker/gemfile_linker.rb | 30 +- .../dependency_linker/gemspec_linker.rb | 2 +- lib/gitlab/dependency_linker/method_linker.rb | 10 +- lib/gitlab/dependency_linker/package.rb | 19 + .../dependency_linker/package_json_linker.rb | 19 +- .../dependency_linker/parser/gemfile.rb | 40 ++ .../dependency_linker/podfile_linker.rb | 11 +- .../dependency_linker/podspec_linker.rb | 2 +- .../import_export/merge_request_parser.rb | 11 + lib/gitlab/import_export/shared.rb | 2 +- lib/gitlab/kubernetes/kube_client.rb | 8 + locale/gitlab.pot | 3 + qa/Gemfile | 1 + qa/Gemfile.lock | 3 + .../push_mirroring_over_http_spec.rb | 3 +- qa/spec/spec_helper.rb | 12 + qa/spec/spec_helper_spec.rb | 51 ++ .../dashboard/milestones_controller_spec.rb | 2 +- .../authorizations_controller_spec.rb | 60 +- .../groups/shared_projects_controller_spec.rb | 2 + .../autocomplete_sources_controller_spec.rb | 37 ++ .../projects/group_links_controller_spec.rb | 37 ++ spec/controllers/snippets_controller_spec.rb | 4 + spec/features/issues_spec.rb | 4 +- .../merge_request/user_sees_versions_spec.rb | 6 +- .../user_lists_merge_requests_spec.rb | 4 +- .../features/profiles/active_sessions_spec.rb | 48 +- .../features/projects/blobs/blob_show_spec.rb | 5 +- .../projects/members/invite_group_spec.rb | 2 + .../settings/user_manages_group_links_spec.rb | 1 + .../security/group/private_access_spec.rb | 25 + spec/finders/merge_requests_finder_spec.rb | 566 +++++++++++------- .../project_url_constrainer_spec.rb | 4 + .../composer_json_linker_spec.rb | 4 +- .../dependency_linker/gemfile_linker_spec.rb | 9 +- .../dependency_linker/gemspec_linker_spec.rb | 4 +- .../package_json_linker_spec.rb | 18 +- .../dependency_linker/parser/gemfile_spec.rb | 42 ++ .../dependency_linker/podfile_linker_spec.rb | 5 +- .../dependency_linker/podspec_linker_spec.rb | 4 +- .../merge_request_parser_spec.rb | 16 + spec/lib/gitlab/import_export/shared_spec.rb | 10 + .../lib/gitlab/kubernetes/kube_client_spec.rb | 30 + spec/mailers/notify_spec.rb | 56 +- spec/models/active_session_spec.rb | 5 +- .../clusters/platforms/kubernetes_spec.rb | 16 + spec/models/concerns/issuable_spec.rb | 97 ++- spec/models/concerns/milestoneish_spec.rb | 142 ++++- spec/models/issue/metrics_spec.rb | 6 +- spec/models/merge_request_diff_spec.rb | 14 +- spec/models/milestone_spec.rb | 8 +- .../prometheus_service_spec.rb | 63 +- spec/models/project_spec.rb | 10 + spec/policies/commit_policy_spec.rb | 53 ++ spec/policies/group_policy_spec.rb | 36 +- spec/policies/note_policy_spec.rb | 94 ++- spec/policies/project_policy_spec.rb | 20 +- spec/requests/api/commits_spec.rb | 15 +- spec/requests/api/issues_spec.rb | 2 +- spec/requests/api/projects_spec.rb | 71 ++- spec/requests/api/release/links_spec.rb | 16 + spec/requests/api/runner_spec.rb | 9 + spec/requests/git_http_spec.rb | 134 +++-- .../common_system_notes_service_spec.rb | 4 +- spec/services/issues/build_service_spec.rb | 76 +-- spec/services/issues/update_service_spec.rb | 6 +- .../merge_requests/build_service_spec.rb | 9 + .../merge_requests/update_service_spec.rb | 6 +- .../group_links/create_service_spec.rb | 8 + spec/support/helpers/file_mover_helpers.rb | 12 + .../issuable_shared_examples.rb | 2 +- .../requests/api/discussions.rb | 31 + spec/uploaders/file_mover_spec.rb | 33 +- spec/validators/sha_validator_spec.rb | 40 ++ .../_merge_requests_status.html.haml_spec.rb | 6 + ..._pipeline_for_merge_request_worker_spec.rb | 2 +- 129 files changed, 2040 insertions(+), 687 deletions(-) create mode 100644 app/validators/sha_validator.rb create mode 100644 lib/gitlab/dependency_linker/package.rb create mode 100644 lib/gitlab/dependency_linker/parser/gemfile.rb create mode 100644 spec/controllers/projects/autocomplete_sources_controller_spec.rb create mode 100644 spec/lib/gitlab/dependency_linker/parser/gemfile_spec.rb create mode 100644 spec/policies/commit_policy_spec.rb create mode 100644 spec/support/helpers/file_mover_helpers.rb create mode 100644 spec/validators/sha_validator_spec.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index feda5e0835..ef2ce0ab52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,48 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 11.8.2 (2019-03-13) + +### Security (1 change) + +- Fixed ability to see private groups by users not belonging to given group. + +### Fixed (5 changes) + +- Fix import_jid error on project import. !25239 +- Properly handle multiple X-Forwarded-For addresses in runner IP. !25511 +- Fix error when viewing group issue boards when user doesn't have explicit group permissions. !25524 +- Fix method to mark a project repository as writable. !25546 +- Allow project members to see private group if the project is in the group namespace. + + +## 11.8.1 (2019-02-28) + +### Security (21 changes) + +- Stop linking to unrecognized package sources. !55518 +- Don't allow non-members to see private related MRs. +- Do not display impersonated sessions under active sessions and remove ability to revoke session. +- Display only information visible to current user on the Milestone page. +- Show only merge requests visible to user on milestone detail page. +- Disable issue boards API when issues are disabled. +- Don't show new issue link after move when a user does not have permissions. +- Fix git clone revealing private repo's presence. +- Fix blind SSRF in Prometheus integration by checking URL before querying. +- Check snippet attached file to be moved is within designated directory. +- Check if desired milestone for an issue is available. +- Fix arbitrary file read via diffs during import. +- Display the correct number of MRs a user has access to. +- Forbid creating discussions for users with restricted access. +- Do not disclose milestone titles for unauthorized users. +- Validate session key when authorizing with GCP to create a cluster. +- Block local URLs for Kubernetes integration. +- Limit mermaid rendering to 5K characters. +- Remove the possibility to share a project with a group that a user is not a member of. +- Fix leaking private repository information in API. +- Prevent releases links API to leak tag existance. + + ## 11.8.0 (2019-02-22) ### Security (7 changes, 1 of them is from the community) diff --git a/VERSION b/VERSION index 897063bb32..95da6166f2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.8.0 +11.8.2 diff --git a/app/assets/javascripts/behaviors/markdown/render_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_mermaid.js index 35380ca49f..798114b4b0 100644 --- a/app/assets/javascripts/behaviors/markdown/render_mermaid.js +++ b/app/assets/javascripts/behaviors/markdown/render_mermaid.js @@ -1,4 +1,5 @@ import flash from '~/flash'; +import { sprintf, __ } from '../../locale'; // Renders diagrams and flowcharts from text using Mermaid in any element with the // `js-render-mermaid` class. @@ -14,6 +15,9 @@ import flash from '~/flash'; // // +// This is an arbitary number; Can be iterated upon when suitable. +const MAX_CHAR_LIMIT = 5000; + export default function renderMermaid($els) { if (!$els.length) return; @@ -34,6 +38,21 @@ export default function renderMermaid($els) { $els.each((i, el) => { const source = el.textContent; + /** + * Restrict the rendering to a certain amount of character to + * prevent mermaidjs from hanging up the entire thread and + * causing a DoS. + */ + if (source && source.length > MAX_CHAR_LIMIT) { + el.textContent = sprintf( + __( + 'Cannot render the image. Maximum character count (%{charLimit}) has been exceeded.', + ), + { charLimit: MAX_CHAR_LIMIT }, + ); + return; + } + // Remove any extra spans added by the backend syntax highlighting. Object.assign(el, { textContent: source }); diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue index abbbe19c5e..57c4dfbe3b 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue +++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue @@ -315,7 +315,7 @@ export default { :endpoint="mr.testResultsPath" /> -
+