Ruby में RCE बग, Rails बिना Auth खतरे में
मूल शीर्षक: Ruby2ßhell: Pre-authentication RCE on stock Rails
यह क्यों महत्वपूर्ण है
बिना authentication के network-reachable RCE, default Rails deployments को तुरंत patch की ज़रूरत है।
Veria Labs ने Ruby के string case conversion में एक critical one-byte heap overflow (GHSA-34m4-m9fh-gqp5) खोजा है। Rails और Sinatra default config में बिना authentication के network से exploit होते हैं। Fixed versions: 3.3.14, 3.4.13, 4.0.10।
Veria Labs ने 'Ruby2Shell' नाम से एक critical vulnerability का खुलासा किया है जो Ruby 2.4.0 से चली आ रही है। बग की जड़ ISO-8859 और Windows-125x encoding में है: जर्मन अक्षर ß को upcase करने पर दो bytes (SS) लिखे जाते हैं, लेकिन loop केवल एक byte के लिए bounds-check करता है। Output buffer input length + 20 bytes का होता है, इसलिए 21 ß वाला input buffer को ठीक एक byte overflow कर देता है।
यह bug `upcase`, `swapcase`, `downcase(:fold)` और `casecmp?` — सभी से trigger होता है। UTF-8 strings अप्रभावित हैं क्योंकि वे अलग code path लेती हैं। Rails और Sinatra (classic style) default configuration में network से, बिना किसी authentication के, इस bug तक पहुँचा जा सकता है।
Popular self-hosted software भी प्रभावित है: GitLab 19.6.0 (Ruby 3.3.13), GitHub Enterprise Server 3.22.5 (Ruby 4.0.9), और Chatwoot 4.20.0 (Ruby 3.4.4) अभी vulnerable हैं। Mastodon 4.7.6, OpenProject 17.9.8 और Discourse ने fixed Ruby bundle कर दिया है। Fix upstream commit ruby/ruby@d582f8f में है। Proof of concept एक हफ्ते में publish होगा।