提交 90768b3a 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/security/gitlab@12-8-stable-ee

上级 40a4f1e0
...@@ -9,10 +9,11 @@ Set the title to: `Description of the original issue` ...@@ -9,10 +9,11 @@ Set the title to: `Description of the original issue`
## Prior to starting the security release work ## Prior to starting the security release work
- [ ] Read the [security process for developers] if you are not familiar with it. - [ ] Read the [security process for developers] if you are not familiar with it.
- [ ] Link this issue in the Security Release issue on GitLab.com. You can find this issue in the topic of the `#releases` channel. - [ ] Mark this [issue as related] to the Security Release tracking issue. You can find it on the topic of the `#releases` Slack channel.
- [ ] Add a link to the confidential `gitlab-org/gitlab` issue describing the vulnerability next to **Original issue** in the [links table](#links).
- [ ] Add a link to the confidential `gitlab-org/gitlab` Security release issue next to **Security release issue** in the [links table](#links).
- [ ] Run `scripts/security-harness` in your local repository to prevent accidentally pushing to any remote besides `gitlab.com/gitlab-org/security`. - [ ] Run `scripts/security-harness` in your local repository to prevent accidentally pushing to any remote besides `gitlab.com/gitlab-org/security`.
- Fill out the [Links section](#links):
- [ ] Next to **Issue on GitLab**, add a link to the `gitlab-org/gitlab` issue that describes the security vulnerability.
- [ ] Next to **Security Release tracking issue**, add a link to the security release issue that will include this security issue.
## Development ## Development
...@@ -29,7 +30,8 @@ After your merge request has being approved according to our [approval guideline ...@@ -29,7 +30,8 @@ After your merge request has being approved according to our [approval guideline
* You can use the script `bin/secpick` instead of the following steps, to help you cherry-picking. See the [secpick documentation] * You can use the script `bin/secpick` instead of the following steps, to help you cherry-picking. See the [secpick documentation]
- [ ] Create each MR targeting the stable branch `X-Y-stable`, using the [Security Release merge request template]. - [ ] Create each MR targeting the stable branch `X-Y-stable`, using the [Security Release merge request template].
* Every merge request will have its own set of TODOs, so make sure to complete those. * Every merge request will have its own set of TODOs, so make sure to complete those.
- [ ] Make sure all MRs are linked in the [Links section](#links) - [ ] On the "Related merge requests" section, ensure all MRs are linked to this issue.
* This section should only list the merge requests created for this issue: One targeting `master` and the 3 backports.
## Documentation and final details ## Documentation and final details
...@@ -46,12 +48,8 @@ After your merge request has being approved according to our [approval guideline ...@@ -46,12 +48,8 @@ After your merge request has being approved according to our [approval guideline
| Description | Link | | Description | Link |
| -------- | -------- | | -------- | -------- |
| Original issue | #TODO | | Issue on [GitLab](https://gitlab.com/gitlab-org/gitlab/issues) | #TODO |
| Security release issue | #TODO | | Security Release tracking issue | #TODO |
| `master` MR | !TODO |
| `Backport X.Y` MR | !TODO |
| `Backport X.Y` MR | !TODO |
| `Backport X.Y` MR | !TODO |
### Details ### Details
...@@ -68,5 +66,6 @@ After your merge request has being approved according to our [approval guideline ...@@ -68,5 +66,6 @@ After your merge request has being approved according to our [approval guideline
[security Release merge request template]: https://gitlab.com/gitlab-org/security/gitlab/blob/master/.gitlab/merge_request_templates/Security%20Release.md [security Release merge request template]: https://gitlab.com/gitlab-org/security/gitlab/blob/master/.gitlab/merge_request_templates/Security%20Release.md
[code review process]: https://docs.gitlab.com/ee/development/code_review.html [code review process]: https://docs.gitlab.com/ee/development/code_review.html
[approval guidelines]: https://docs.gitlab.com/ee/development/code_review.html#approval-guidelines [approval guidelines]: https://docs.gitlab.com/ee/development/code_review.html#approval-guidelines
[issue as related]: https://docs.gitlab.com/ee/user/project/issues/related_issues.html#adding-a-related-issue
/label ~security /label ~security
...@@ -8,11 +8,11 @@ See [the general developer security release guidelines](https://gitlab.com/gitla ...@@ -8,11 +8,11 @@ See [the general developer security release guidelines](https://gitlab.com/gitla
## Related issues ## Related issues
<!-- Mention the issue(s) this MR is related to --> <!-- Mention the GitLab Security issue this MR is related to -->
## Developer checklist ## Developer checklist
- [ ] Link this MR in the `links` section of the related issue on [GitLab Security]. - [ ] **Make sure this merge request mentions the [GitLab Security] issue it belongs to (i.e. `Related to <issue_id>`).**
- [ ] Merge request targets `master`, or `X-Y-stable` for backports. - [ ] Merge request targets `master`, or `X-Y-stable` for backports.
- [ ] Milestone is set for the version this merge request applies to. A closed milestone can be assigned via [quick actions]. - [ ] Milestone is set for the version this merge request applies to. A closed milestone can be assigned via [quick actions].
- [ ] Title of this merge request is the same as for all backports. - [ ] Title of this merge request is the same as for all backports.
......
<script> <script>
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import { escape } from 'lodash';
import simplePoll from '../../../lib/utils/simple_poll'; import simplePoll from '../../../lib/utils/simple_poll';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
import statusIcon from '../mr_widget_status_icon.vue'; import statusIcon from '../mr_widget_status_icon.vue';
...@@ -44,11 +45,10 @@ export default { ...@@ -44,11 +45,10 @@ export default {
fastForwardMergeText() { fastForwardMergeText() {
return sprintf( return sprintf(
__( __(
`Fast-forward merge is not possible. Rebase the source branch onto %{startTag}${this.mr.targetBranch}%{endTag} to allow this merge request to be merged.`, 'Fast-forward merge is not possible. Rebase the source branch onto %{targetBranch} to allow this merge request to be merged.',
), ),
{ {
startTag: '<span class="label-branch">', targetBranch: `<span class="label-branch">${escape(this.mr.targetBranch)}</span>`,
endTag: '</span>',
}, },
false, false,
); );
......
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
.form-group.row.d-flex.gl-pl-3.gl-pr-3.branch-selector .form-group.row.d-flex.gl-pl-3.gl-pr-3.branch-selector
.align-self-center .align-self-center
%span= s_('From %{source_title} into').html_safe % { source_title: "<code>#{source_title}</code>".html_safe } %span
= _('From <code>%{source_title}</code> into').html_safe % { source_title: source_title }
- if issuable.new_record? - if issuable.new_record?
%code= target_title %code= target_title
&nbsp; &nbsp;
......
---
title: Fix for XSS in branch names
merge_request:
author:
type: security
...@@ -8208,6 +8208,9 @@ msgstr "" ...@@ -8208,6 +8208,9 @@ msgstr ""
msgid "Failure" msgid "Failure"
msgstr "" msgstr ""
msgid "Fast-forward merge is not possible. Rebase the source branch onto %{targetBranch} to allow this merge request to be merged."
msgstr ""
msgid "Fast-forward merge is not possible. Rebase the source branch onto the target branch or merge target branch into source branch to allow this merge request to be merged." msgid "Fast-forward merge is not possible. Rebase the source branch onto the target branch or merge target branch into source branch to allow this merge request to be merged."
msgstr "" msgstr ""
...@@ -8655,7 +8658,7 @@ msgstr "" ...@@ -8655,7 +8658,7 @@ msgstr ""
msgid "From %{providerTitle}" msgid "From %{providerTitle}"
msgstr "" msgstr ""
msgid "From %{source_title} into" msgid "From <code>%{source_title}</code> into"
msgstr "" msgstr ""
msgid "From Bitbucket" msgid "From Bitbucket"
......
...@@ -5,9 +5,9 @@ require "spec_helper" ...@@ -5,9 +5,9 @@ require "spec_helper"
describe "User creates a merge request", :js do describe "User creates a merge request", :js do
include ProjectForksHelper include ProjectForksHelper
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:user) }
let(:title) { "Some feature" } let(:title) { "Some feature" }
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
before do before do
project.add_maintainer(user) project.add_maintainer(user)
...@@ -38,6 +38,26 @@ describe "User creates a merge request", :js do ...@@ -38,6 +38,26 @@ describe "User creates a merge request", :js do
end end
end end
context "XSS branch name exists" do
before do
project.repository.create_branch("<img/src='x'/onerror=alert('oops')>", "master")
end
it "doesn't execute the dodgy branch name" do
visit(project_new_merge_request_path(project))
find(".js-source-branch").click
click_link("<img/src='x'/onerror=alert('oops')>")
find(".js-target-branch").click
click_link("feature")
click_button("Compare branches")
expect { page.driver.browser.switch_to.alert }.to raise_error(Selenium::WebDriver::Error::NoSuchAlertError)
end
end
context "to a forked project" do context "to a forked project" do
let(:forked_project) { fork_project(project, user, namespace: user.namespace, repository: true) } let(:forked_project) { fork_project(project, user, namespace: user.namespace, repository: true) }
......
文件模式从 100755 更改为 100644
文件模式从 100755 更改为 100644
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册