-
- Downloads
Handle Stored XSS for Grafana URL in settings
- Extend Gitlab::UrlBlocker to allow relative urls (require_absolute setting). The new `require_absolute` setting defaults to true, which is the existing behavior. - Extend AddressableUrlValidator to accept `require_abosolute` and default to the existing behavior - Add validation for ApplicationSetting#grafana_url to validate that the URL does not contain XSS but can be a valid relative or absolute url. - In the case of existing stored URLs, validate the stored URL does not contain XSS. If the stored URL contains stored XSS or is an otherwise invalid URL, return the default database column value. - Add tests for Gitlab::UrlBlocker to test require_absolute setting - Add tests for AddressableUrlValidator - Add tests for ApplicationSetting#grafana_url
Showing
- app/models/application_setting.rb 20 additions, 1 deletionapp/models/application_setting.rb
- app/validators/addressable_url_validator.rb 2 additions, 1 deletionapp/validators/addressable_url_validator.rb
- changelogs/unreleased/security-xss-grafana-url-12-4.yml 5 additions, 0 deletionschangelogs/unreleased/security-xss-grafana-url-12-4.yml
- lib/gitlab/url_blocker.rb 32 additions, 12 deletionslib/gitlab/url_blocker.rb
- spec/lib/gitlab/url_blocker_spec.rb 60 additions, 0 deletionsspec/lib/gitlab/url_blocker_spec.rb
- spec/models/application_setting_spec.rb 6 additions, 0 deletionsspec/models/application_setting_spec.rb
- spec/requests/api/commit_statuses_spec.rb 1 addition, 1 deletionspec/requests/api/commit_statuses_spec.rb
- spec/validators/addressable_url_validator_spec.rb 63 additions, 0 deletionsspec/validators/addressable_url_validator_spec.rb
Please register or sign in to comment