One of the two SQL injection vulnerabilities affects applications running on Rails 2.0.0 to 3.2.18 that also use the PostgreSQL database system and query bit string data types. The second vulnerability affects applications running on Rails 4.0.0 to 4.1.2 when using PostgreSQL and querying range data types.

Despite affecting different versions, the two flaws are related and both allow attackers to inject arbitrary SQL code into queries using specially crafted values.

"The only feasible workaround for this issue is to not allow user controlled values to be used in queries with the affected data types," the Rails developers said in a security advisory. "Given the difficulty of ensuring this, upgrading is strongly advised."

For cases where an immediate version upgrade is not possible, the developers also released code patches that can be applied manually.

Ruby on Rails has gained popularity among developers in recent years and is already used by large sites including Hulu, Scribd, Kickstarter and GitHub. This earned the framework inclusion into the Internet Bug Bounty program sponsored by Facebook and Microsoft as "a critical piece of internet infrastructure."