You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flagging here that resque's dependency on sinatra has a known vulnerability (CVE-2024-21510). An active issue is being worked on. Found as a result of sentry-ruby dependency on resque.
Updating ruby-advisory-db ...
From https://github.com/rubysec/ruby-advisory-db
* branch master -> FETCH_HEAD
Already up to date.
Updated ruby-advisory-db
ruby-advisory-db:
advisories: 946 advisories
last updated: 2024-11-02 13:23:04 -0700
commit: a30efc46eef41d6412f5b2d6853a1750bd0035d2
No vulnerabilities found
Actual Behavior
Updating ruby-advisory-db ...
From https://github.com/rubysec/ruby-advisory-db
* branch master -> FETCH_HEAD
Already up to date.
Updated ruby-advisory-db
ruby-advisory-db:
advisories: 946 advisories
last updated: 2024-11-02 13:23:04 -0700
commit: a30efc46eef41d6412f5b2d6853a1750bd0035d2
Name: sinatra
Version: 3.2.0
CVE: CVE-2024-21510
GHSA: GHSA-hxx2-7vcw-mqr3
Criticality: Medium
URL: https://github.com/advisories/GHSA-hxx2-7vcw-mqr3
Title: Sinatra vulnerable to Reliance on Untrusted Inputs in a Security Decision
Solution: remove or disable this gem until a patch is available!
Vulnerabilities found!
It looks like there's a patch out but the maintainer has no plans to backport it to 3.X. I might try and have a look at what the update would do but I haven't contributed to or worked on this codebase before; has anybody else got a fix in the works?
This sets the proper config by default on all Sinatra apps mounted as engines (including resque-web) to the same list as the Rails authorized hosts list, so it lets you upgrade to Sinatra to 4.1.0 or later.
The proper way to fix this would be to add this sinatra config when the engine gets mounted, but I'm using several unpatched engines that rely on Sinatra so this was a quicker fix.
Thanks for the monkey-patch, @jeromecornet it worked perfectly! I was getting a "Host not permitted" error when accessing the Resque web UI via a custom domain (e.g., myapp.local:3000/admin/resque), but localhost:3000/admin/resque worked fine. Appreciate the fix!
Activity
[-]Sinatra Dependency Vulnerability [/-][+]Sinatra Dependency Vulnerability (CVE-2024-21510)[/+]bermannoah commentedon Nov 22, 2024
It looks like there's a patch out but the maintainer has no plans to backport it to 3.X. I might try and have a look at what the update would do but I haven't contributed to or worked on this codebase before; has anybody else got a fix in the works?
jeromecornet commentedon Dec 29, 2024
I figured I'd share a monkey-patch while waiting for a proper fix for this:
I am using (for now) the following monkey-patch in my rails app (in
config/initializers/sinatra.rb)This sets the proper config by default on all Sinatra apps mounted as engines (including resque-web) to the same list as the Rails authorized hosts list, so it lets you upgrade to Sinatra to 4.1.0 or later.
The proper way to fix this would be to add this sinatra config when the engine gets mounted, but I'm using several unpatched engines that rely on Sinatra so this was a quicker fix.
tobyond commentedon Feb 28, 2025
Thanks for the monkey-patch, @jeromecornet it worked perfectly! I was getting a "Host not permitted" error when accessing the Resque web UI via a custom domain (e.g., myapp.local:3000/admin/resque), but localhost:3000/admin/resque worked fine. Appreciate the fix!
FangjianLu commentedon Sep 25, 2025
For non Rails app, I managed to get it work by adding below before calling
Resque::Server.newinconfig.ruzzak commentedon Nov 25, 2025
This can be closed too
mikevoets commentedon Mar 2, 2026
Can we expect a fix or compatibility with Sinatra 4.x at some point, or shall we simply apply the monkey-patch?