Skip to content

Replace WEBrick because it is no longer recommended for production use #4648

Open

Description

@sparrowt

Describe the bug

Fluentd depends on webrick and uses it in quite a few places and thus although it's no longer included in ruby, it is required (e.g. the dockerfile installs ruby-webrick).

There have been a fair few CVEs reported for webrick in recent years, but more worrying is that in response to a recent security vulnerability report, one of the maintainers said "webrick is not for production".

If fluentd contines to rely on this, it feels risky (e.g. maybe future reports may not be patched so quickly / at all).

Perhaps it would be wise to migrate each usage away from webrick to a production-suitable replacement?

To Reproduce

Install fluentd - you will not be able to do this without also installing webrick.

Expected behavior

We should move away from production use of a package which the maintainers no longer recommend for production use.

Your Environment

- Fluentd version: all recent versions
- Package version: N/A
- Operating system: N/A
- Kernel version: N/A

Your Configuration

Any configuration.

Your Error Log

N/A

Additional context

No response

Activity

  1. changed the title [-]Fluentd relies on webrick which is no longer recommended for production use[/-] [+]Replace WEBrick because it is no longer recommended for production use[/+] on Sep 27, 2024
  2. daipom commented on Sep 27, 2024

    @daipom
    Contributor

    Thanks for your report.
    This is more likely enhancement request rather than bug report.
    I think we need more opinions and ideas.

  3. Athishpranav2003 commented on Sep 27, 2024

    @Athishpranav2003
    Contributor

    @daipom i saw this alternative
    https://github.com/socketry/falcon

    Not sure if there are other alternatives, need to research more

  4. daipom commented on Oct 2, 2024

    @daipom
    Contributor

    @Athishpranav2003 Thanks!
    So, Falcon is an option for us!

    Sorry, since I'm unfamiliar with these libraries and don't have much time this month, I cannot say for sure about the direction now.

  5. Athishpranav2003 commented on Oct 2, 2024

    @Athishpranav2003
    Contributor

    It's similar for me
    Maybe others active in Ruby community can give some comments on this
    @Watson1978 ?

  6. Watson1978 commented on Oct 2, 2024

    @Watson1978
    Contributor

    Fluentd has been used async-http and webrick for http server in in_http and RPC.
    I think it would be better to integrate them into one library (async-http, falcon or another).

  7. dentarg commented on Oct 2, 2024

    @dentarg

    The most popular Ruby web server is Puma: https://github.com/puma/puma

  8. Leodau commented on Feb 5, 2025

    @Leodau

    Can we please get an update on this one?

    https://security.snyk.io/vuln/SNYK-RUBY-WEBRICK-8068535

  9. Watson1978 commented on Feb 6, 2025

    @Watson1978
    Contributor

    @Leodau Seems that the latest fluent-package LTS v5.0.5 contains webrick v1.8.2.
    https://github.com/fluent/fluent-package-builder/releases/tag/v5.0.5

  10. daipom commented on Apr 10, 2025

    @daipom
    Contributor

    Fluentd uses WEBrick for the following features mainly:

    • RPC server
    • http_server plugin helper (only when async is not installed, the feature is fallbacked to WEBrick)

    We should remove the fallback feature of http_server plugin helper.
    It was made for supporting environments whose Ruby version < 2.3.

    For the RPC server, we should consider using http_server plugin helper.

  11. 9 remaining items

  12. moved this from Work-In-Progress to Done in Fluentd Kanbanon Apr 10, 2025
  13. reopened this on Apr 10, 2025
  14. moved this from Done to To-Do in Fluentd Kanbanon Apr 10, 2025
  15. added 2 commits that reference this issue on Apr 10, 2025
    e445acf
    83c19d1
  16. daipom commented on Apr 10, 2025

    @daipom
    Contributor

    Remaining:

    • RPC server
    • in_http (WEBrick::HTTPUtils)

    I have no idea how to replace multipart/form-data handling in in_http.

    elsif @content_type =~ /^multipart\/form-data; boundary=(.+)/
    boundary = WEBrick::HTTPUtils.dequote($1)
    params.update WEBrick::HTTPUtils.parse_form_data(@body, boundary)

    It may not be important to avoid using WEBrick::HTTPUtils since it is just utils.

  17. kenhys commented on Jun 25, 2025

    @kenhys
    Contributor

    If the remaining issues could be also fixed in a timely for v1.19,
    it is okay to merge #4900 .

  18. daipom commented on Jun 25, 2025

    @daipom
    Contributor

    If the remaining issues could be also fixed in a timely for v1.19, it is okay to merge #4900 .

    Remaining issues except for #4900:

    • RPC server
    • in_http: multipart/form-data
  19. added a commit that references this issue on Jul 30, 2025
    6ce90f9
  20. reopened this on Jul 30, 2025
  21. daipom commented on Jul 30, 2025

    @daipom
    Contributor

    #4900 is merged.

    Remaining:

    * RPC server
    * `in_http`: `multipart/form-data`
    
  22. Leodau commented on Sep 3, 2025

    @Leodau

    Awesome thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature request or improve operations

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions