Skip to content

Restrict Rouge formatters to Rouge::Formatters namespace - #708

Closed
stanhu wants to merge 1 commit into
gettalong:masterfrom
stanhu:sh-restrict-rouge-formatter-lookup
Closed

stanhu wants to merge 1 commit into
gettalong:masterfrom
stanhu:sh-restrict-rouge-formatter-lookup

Conversation

@stanhu

@stanhu stanhu commented Mar 14, 2021 •

Copy link
Copy Markdown
Contributor

ff0218a added support for specifying custom Rouge formatters with the constraint that the formatter be in theRouge::Formatters namespace, but it did not actually enforce this constraint. For example, this is valid:

Rouge::Formatters.const_get('CSV')
=> CSV

Adding the false parameter to const_get prevents this:

Rouge::Formatters.const_get('CSV', false)
NameError: uninitialized constant Rouge::Formatters::CSV

@stanhu
stanhu force-pushed the sh-restrict-rouge-formatter-lookup branch from 71c59ea to fc7872e Compare March 14, 2021 18:26
@stanhu stanhu changed the title Restrict Rouge formatters to values in Rouge::Formatters namespace Restrict Rouge formatters to Rouge::Formatters namespace Mar 14, 2021
@stanhu
stanhu force-pushed the sh-restrict-rouge-formatter-lookup branch from fc7872e to 28b725c Compare March 14, 2021 18:45
ff0218a added support for specifying custom Rouge formatters with the
constraint that the formatter be in theRouge::Formatters namespace, but
it did not actually enforce this constraint. For example, this is valid:

```ruby
Rouge::Formatters.const_get('CSV')
=> CSV
```

Adding the `false` parameter to `const_get` prevents this:

```ruby
Rouge::Formatters.const_get('CSV', false)
NameError: uninitialized constant Rouge::Formatters::CSV
```
@stanhu
stanhu force-pushed the sh-restrict-rouge-formatter-lookup branch from 28b725c to d6a1cbc Compare March 14, 2021 18:47
@gettalong

Copy link
Copy Markdown
Owner

Thanks! I think this makes sense also from a security point of view.

@stanhu

stanhu commented Mar 15, 2021

Copy link
Copy Markdown
Contributor Author

@gettalong Thanks! Would you mind merging and tagging a new release?

@gettalong

Copy link
Copy Markdown
Owner

There will be a release in due time.

@gettalong

Copy link
Copy Markdown
Owner

Thank you - merged and will be in the upcoming release.

@gettalong gettalong closed this Mar 17, 2021
@aleksandrs-ledovskis

Copy link
Copy Markdown

Source of CVSS 9.9 in GitLab.

I see no reason to keep it disconnected/under wraps once the patch (and consequently the vector) is known.

@rfrohl

rfrohl commented Mar 18, 2021 •

Copy link
Copy Markdown

this issue got CVE-2021-28834 assigned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants