Skip to content

Announce RDoc update on CVE-2021-31799 #2645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions en/news/_posts/2021-05-02-os-command-injection-in-rdoc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
layout: news_post
title: "A command injection vulnerability in RDoc"
author: "aycabta"
translator:
date: 2021-05-02 09:00:00 +0000
tags: security
lang: en
---

There is a vulnerability about Command Injection in RDoc which is bundled in Ruby.
It is recommended that all Ruby users update RDoc to the latest version that fixes this issue.

## Details

The following vulnerability has been reported.

* [CVE-2021-31799](https://nvd.nist.gov/vuln/detail/CVE-2021-31799)

RDoc used to call `Kernel#open` to open a local file. If a Ruby project has a file whose name starts with `|` and ends with `tags`, the command following the pipe character is executed. A malicious Ruby project could exploit it to run an arbitrary command execution against a user who attempts to run `rdoc` command.

Ruby users whose version of RDoc is affected by this issue should update to the latest version of RDoc.

## Affected Versions

* All releases of RDoc from 3.11 to 6.3.0

## How to Update

Run the following command to update RDoc to the latest version (6.3.1 or later) to fix the vulnerability.

```
gem install rdoc
```

## Credits

Thanks to [Alexandr Savca](https://hackerone.com/chinarulezzz) for reporting the issue.

## History

* Originally published at 2021-05-02 09:00:00 UTC
42 changes: 42 additions & 0 deletions ja/news/_posts/2021-05-02-os-command-injection-in-rdoc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
layout: news_post
title: "RDoc におけるコマンドインジェクションの脆弱性について"
author: "aycabta"
translator:
date: 2021-05-02 09:00:00 +0000
tags: security
lang: ja
---

Ruby の標準添付ツールである RDoc にコマンドインジェクションの脆弱性が発見されました。
全ての Ruby ユーザーは、RDoc をこの問題が修正された最新バージョンに更新することが推奨されます。

## 詳細

以下の脆弱性が報告されています。

* [CVE-2021-31799](https://nvd.nist.gov/vuln/detail/CVE-2021-31799)

RDoc はローカルのファイルを開くために、`Kernel#open` を使用していました。しかし、もし Ruby プロジェクトに `|` で始まり `tags` で終わる名前のファイルが存在していた場合、パイプ文字以降に並べられたコマンドが実行されてしまいます。悪意のある Ruby プロジェクトは、ドキュメントを生成しようとしたユーザに任意のコマンドを実行させることができます。

この問題の影響を受けるバージョンの RDoc を含む Ruby のユーザーは、最新の RDoc に更新してください。

## 影響を受けるバージョン

* RDoc 3.11 から 6.3.0 までの全てのリリース

## 更新方法

以下のコマンドを実行し、RDoc を最新版 (6.3.1 以降) に更新することによって、脆弱性が修正されます。

```
gem install rdoc
```

## クレジット

この脆弱性情報は、[Alexandr Savca](https://hackerone.com/chinarulezzz) 氏によって報告されました。

## 更新履歴

* 2021-05-02 18:00:00 (JST) 初版