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 = `