Commit c6023d15 authored by GitLab Release Tools Bot's avatar GitLab Release Tools Bot

Merge branch 'security-fixes-release-asset-link-filepath-ReDoS' into 'master'

Fixes release asset link filepath ReDoS

See merge request gitlab-org/security/gitlab!924
parents 8399fb66 73cc5591
......@@ -6,7 +6,9 @@ module Releases
belongs_to :release
FILEPATH_REGEX = %r{\A/(?:[\-\.\w]+/?)*[\da-zA-Z]+\z}.freeze
# See https://gitlab.com/gitlab-org/gitlab/-/issues/218753
# Regex modified to prevent catastrophic backtracking
FILEPATH_REGEX = %r{\A\/[^\/](?!.*\/\/.*)[\-\.\w\/]+[\da-zA-Z]+\z}.freeze
validates :url, presence: true, addressable_url: { schemes: %w(http https ftp) }, uniqueness: { scope: :release }
validates :name, presence: true, uniqueness: { scope: :release }
......
---
title: Fixes release asset link filepath ReDoS
merge_request:
author:
type: security
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment