From 03a7b5db894d4c34d64a276124d45b167a5701c6 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Tue, 8 Dec 2020 15:28:05 +0530 Subject: [PATCH] New upstream version 13.4.7 --- CHANGELOG.md | 16 ++++ GITALY_SERVER_VERSION | 2 +- VERSION | 2 +- .../behaviors/markdown/render_mermaid.js | 32 +++++-- .../explore/projects_controller.rb | 4 +- app/controllers/search_controller.rb | 1 - app/controllers/users_controller.rb | 2 +- app/finders/projects_finder.rb | 4 + app/finders/starred_projects_finder.rb | 11 +++ app/graphql/types/user_type.rb | 8 +- .../operations/feature_flags/user_list.rb | 5 + app/presenters/user_presenter.rb | 14 +++ .../todos/destroy/entity_leave_service.rb | 6 +- app/validators/zoom_url_validator.rb | 7 +- app/views/devise/confirmations/new.html.haml | 2 +- .../explore/projects/_projects.html.haml | 8 +- config/application.rb | 1 + config/feature_categories.yml | 1 + ...schedule_remove_inaccessible_epic_todos.rb | 29 ++++++ db/schema_migrations/20201109114603 | 1 + .../geo/disaster_recovery/index.md | 13 ++- doc/administration/geo/index.md | 4 + doc/user/todos.md | 2 +- .../remove_inaccessible_epic_todos.rb | 13 +++ .../confirmations_controller_spec.rb | 80 ++++++++++++++++ spec/controllers/search_controller_spec.rb | 2 +- spec/controllers/users_controller_spec.rb | 91 ++++++++++++++++--- .../explore/user_explores_projects_spec.rb | 13 +++ spec/features/markdown/mermaid_spec.rb | 65 +++++++++++++ spec/finders/projects_finder_spec.rb | 23 +++++ spec/finders/starred_projects_finder_spec.rb | 59 +++++++++--- .../user/starred_projects_query_spec.rb | 27 ++++++ spec/requests/api/graphql/user_query_spec.rb | 48 +++++++++- spec/requests/api/projects_spec.rb | 45 +++++++-- spec/validators/zoom_url_validator_spec.rb | 36 ++++++++ 35 files changed, 620 insertions(+), 57 deletions(-) create mode 100644 db/post_migrate/20201109114603_schedule_remove_inaccessible_epic_todos.rb create mode 100644 db/schema_migrations/20201109114603 create mode 100644 lib/gitlab/background_migration/remove_inaccessible_epic_todos.rb create mode 100644 spec/controllers/confirmations_controller_spec.rb create mode 100644 spec/validators/zoom_url_validator_spec.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f5f837d9c..84f3126d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 13.4.7 (2020-12-07) + +### Security (10 changes) + +- Validate zoom links to start with https only. !1055 +- Require at least 3 characters when searching for project in the Explore page. +- Do not show emails of users in confirmation page. +- Forbid setting a gitlabUserList strategy to a list from another project. +- Fix mermaid resource consumption in GFM fields. +- Ensure group and project memberships are not leaked via API for users with private profiles. +- GraphQL User: do not expose email if set to private. +- Filter search parameter to prevent data leaks. +- Do not expose starred projects of users with private profile via API. +- Do not show starred & contributed projects of users with private profile. + + ## 13.4.6 (2020-11-03) ### Fixed (1 change) diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 56f3fd065d..b64e52773f 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -13.4.6 \ No newline at end of file +13.4.7 \ No newline at end of file diff --git a/VERSION b/VERSION index 56f3fd065d..b64e52773f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -13.4.6 \ No newline at end of file +13.4.7 \ No newline at end of file diff --git a/app/assets/javascripts/behaviors/markdown/render_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_mermaid.js index cb0e634505..37a965de86 100644 --- a/app/assets/javascripts/behaviors/markdown/render_mermaid.js +++ b/app/assets/javascripts/behaviors/markdown/render_mermaid.js @@ -18,7 +18,13 @@ import { __, sprintf } from '~/locale'; // // This is an arbitrary number; Can be iterated upon when suitable. -const MAX_CHAR_LIMIT = 5000; +const MAX_CHAR_LIMIT = 2000; +// Max # of mermaid blocks that can be rendered in a page. +const MAX_MERMAID_BLOCK_LIMIT = 50; +// Keep a map of mermaid blocks we've already rendered. +const elsProcessingMap = new WeakMap(); +let renderedMermaidBlocks = 0; + let mermaidModule = {}; function importMermaidModule() { @@ -110,13 +116,22 @@ function renderMermaids($els) { let renderedChars = 0; $els.each((i, el) => { + // Skipping all the elements which we've already queued in requestIdleCallback + if (elsProcessingMap.has(el)) { + return; + } + const { source } = fixElementSource(el); /** - * Restrict the rendering to a certain amount of character to - * prevent mermaidjs from hanging up the entire thread and - * causing a DoS. + * Restrict the rendering to a certain amount of character + * and mermaid blocks to prevent mermaidjs from hanging + * up the entire thread and causing a DoS. */ - if ((source && source.length > MAX_CHAR_LIMIT) || renderedChars > MAX_CHAR_LIMIT) { + if ( + (source && source.length > MAX_CHAR_LIMIT) || + renderedChars > MAX_CHAR_LIMIT || + renderedMermaidBlocks >= MAX_MERMAID_BLOCK_LIMIT + ) { const html = `