Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
bd200951
Commit
bd200951
authored
Jan 06, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/security/gitlab@13-7-stable-ee
parent
19e2b7fa
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
2 deletions
+60
-2
GITLAB_PAGES_VERSION
GITLAB_PAGES_VERSION
+1
-1
changelogs/unreleased/security-package-regex-dos.yml
changelogs/unreleased/security-package-regex-dos.yml
+5
-0
changelogs/unreleased/security-pages-1-33.yml
changelogs/unreleased/security-pages-1-33.yml
+5
-0
changelogs/unreleased/security-trusted-confidential-apps.yml
changelogs/unreleased/security-trusted-confidential-apps.yml
+5
-0
db/migrate/20201222151823_update_trusted_apps_to_confidential.rb
...ate/20201222151823_update_trusted_apps_to_confidential.rb
+23
-0
db/schema_migrations/20201222151823
db/schema_migrations/20201222151823
+1
-0
db/structure.sql
db/structure.sql
+2
-0
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+12
-1
spec/lib/gitlab/regex_spec.rb
spec/lib/gitlab/regex_spec.rb
+6
-0
No files found.
GITLAB_PAGES_VERSION
View file @
bd200951
1.3
2
.0
1.3
4
.0
changelogs/unreleased/security-package-regex-dos.yml
0 → 100644
View file @
bd200951
---
title
:
Fix regular expression backtracking issue in package name validation
merge_request
:
author
:
type
:
security
changelogs/unreleased/security-pages-1-33.yml
0 → 100644
View file @
bd200951
---
title
:
Fix stealing API token from GitLab Pages and DoS Prometheus through GitLab Pages
merge_request
:
author
:
type
:
security
changelogs/unreleased/security-trusted-confidential-apps.yml
0 → 100644
View file @
bd200951
---
title
:
Update trusted OAuth applications to set them as confidential
merge_request
:
author
:
type
:
security
db/migrate/20201222151823_update_trusted_apps_to_confidential.rb
0 → 100644
View file @
bd200951
# frozen_string_literal: true
class
UpdateTrustedAppsToConfidential
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'tmp_index_oauth_applications_on_id_where_trusted'
disable_ddl_transaction!
def
up
add_concurrent_index
:oauth_applications
,
:id
,
where:
'trusted = true'
,
name:
INDEX_NAME
execute
(
'UPDATE oauth_applications SET confidential = true WHERE trusted = true'
)
end
def
down
# We won't be able to tell which trusted applications weren't confidential before the migration
# and setting all trusted applications are not confidential would introduce security issues
remove_concurrent_index_by_name
:oauth_applications
,
INDEX_NAME
end
end
db/schema_migrations/20201222151823
0 → 100644
View file @
bd200951
d3af120a74b4c55345ac7fb524395251cd3c1b3cd9685f711196a134f427845c
\ No newline at end of file
db/structure.sql
View file @
bd200951
...
...
@@ -23004,6 +23004,8 @@ CREATE INDEX tmp_build_stage_position_index ON ci_builds USING btree (stage_id,
CREATE
INDEX
tmp_index_for_email_unconfirmation_migration
ON
emails
USING
btree
(
id
)
WHERE
(
confirmed_at
IS
NOT
NULL
);
CREATE
INDEX
tmp_index_oauth_applications_on_id_where_trusted
ON
oauth_applications
USING
btree
(
id
)
WHERE
(
trusted
=
true
);
CREATE
INDEX
tmp_index_on_vulnerabilities_non_dismissed
ON
vulnerabilities
USING
btree
(
id
)
WHERE
(
state
<>
2
);
CREATE
UNIQUE
INDEX
unique_merge_request_metrics_by_merge_request_id
ON
merge_request_metrics
USING
btree
(
merge_request_id
);
...
...
lib/gitlab/regex.rb
View file @
bd200951
...
...
@@ -27,7 +27,18 @@ module Gitlab
end
def
package_name_regex
@package_name_regex
||=
%r{
\A\@
?(([
\w\-\.\+
]*)
\/
)*([
\w\-\.
]+)@?(([
\w\-\.\+
]*)
\/
)*([
\w\-\.
]*)
\z
}
.
freeze
@package_name_regex
||=
%r{
\A\@
?
(?> # atomic group to prevent backtracking
(([
\w\-\.\+
]*)
\/
)*([
\w\-\.
]+)
)
@?
(?> # atomic group to prevent backtracking
(([
\w\-\.\+
]*)
\/
)*([
\w\-\.
]*)
)
\z
}x
.
freeze
end
def
maven_file_name_regex
...
...
spec/lib/gitlab/regex_spec.rb
View file @
bd200951
...
...
@@ -292,6 +292,12 @@ RSpec.describe Gitlab::Regex do
it
{
is_expected
.
not_to
match
(
'my package name'
)
}
it
{
is_expected
.
not_to
match
(
'!!()()'
)
}
it
{
is_expected
.
not_to
match
(
"..
\n
..
\f
oo"
)
}
it
'has no backtracking issue'
do
Timeout
.
timeout
(
1
)
do
expect
(
subject
).
not_to
match
(
"-"
*
50000
+
";"
)
end
end
end
describe
'.maven_file_name_regex'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment