Repository navigation
One new trilogy advisory #1286
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
One new trilogy advisory #1286
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3cea4fc
One new trilogy advisory/again
jasnow 3e610ef
Add CERTFR advisory link to GHSA-744p-w4gc-m3gh
jasnow 71fbbc9
Removed trailing blanks on one line
jasnow 9f12f7b
Update gems/trilogy/GHSA-744p-w4gc-m3gh.yml
jasnow 60d357a
Update gems/trilogy/GHSA-744p-w4gc-m3gh.yml
jasnow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| --- | ||
| gem: trilogy | ||
| ghsa: 744p-w4gc-m3gh | ||
| url: https://github.com/trilogy-libraries/trilogy/security/advisories/GHSA-744p-w4gc-m3gh | ||
| title: SQL injection through `Trilogy#escape` with multibyte encodings | ||
| date: 2026-10-29 | ||
| description: | | ||
| `Trilogy#escape` produces unsafe output for Strings in Shift_JIS, | ||
| Windows-31J, Big5, GBK or GB18030. In those encodings, the continuation | ||
| byte of a multi byte character can be in the ASCII range. `escape` was | ||
| intended for strict ASCII supersets and did not handle this correctly, | ||
| which allowed SQL injection. | ||
|
|
||
| ## Details | ||
|
|
||
| Applications are affected in two cases: | ||
|
|
||
| 1. On any connection charset, including the default `utf8mb4`, when | ||
| an attacker can influence the encoding of a String the application | ||
| escapes. | ||
| 2. On connections configured with `encoding: sjis`, `cp932`, `big5`, | ||
| `gbk` or `gb18030`. These connection encodings never worked | ||
| correctly, are no longer supported, and now raise `ArgumentError`. | ||
|
|
||
| ## Impact | ||
|
|
||
| Unauthenticated SQL injection in applications that escape | ||
| attacker-influenced Strings with `Trilogy#escape`. Ruby on Rails and | ||
| other Rack applications using the Trilogy adapter are likely affected. | ||
|
|
||
| ## Workarounds | ||
|
|
||
| Applications unable to upgrade may be able to avoid this issue by | ||
| enforcing the encoding of all strings passed to `Trilogy#escape` and | ||
| `Trilogy#query`. | ||
|
|
||
| ## Credit | ||
|
|
||
| Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-9KOHJMNW | ||
| cvss_v4: 9.3 | ||
| patched_versions: | ||
| - ">= 2.13.2" | ||
| related: | ||
| url: | ||
| - https://rubygems.org/gems/trilogy/versions/2.13.2 | ||
| - https://github.com/trilogy-libraries/trilogy/compare/v2.13.1...v2.13.2 | ||
| - https://github.com/anthropics/oss-scanner | ||
| - https://greg.molnar.io/blog/sql-injection-in-the-trilogy-mysql-adapter | ||
| - https://www.cert.cyber.gouv.fr/avis/CERTFR-2026-AVI-1424 | ||
| - https://discuss.rubyonrails.org/t/ghsa-744p-w4gc-m3gh-sql-injection-through-trilogy-escape-with-multibyte-encodings/91797 | ||
| - https://github.com/trilogy-libraries/trilogy/security/advisories/GHSA-744p-w4gc-m3gh | ||
| notes: | | ||
| - cvss_v4 from GHSA URL. | ||
| - No CVE in GHSA URL. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.