Skip to content

Update Rust crate sqlx to 0.8.1 [SECURITY]#22

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/crate-sqlx-vulnerability
Open

Update Rust crate sqlx to 0.8.1 [SECURITY]#22
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/crate-sqlx-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Aug 24, 2024

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
sqlx dev-dependencies minor 0.70.8.1

SQLx Binary Protocol Misinterpretation caused by Truncating or Overflowing Casts

GHSA-xmrp-424f-vfpx

More information

Details

The following presentation at this year's DEF CON was brought to our attention on the SQLx Discord:

SQL Injection isn't Dead: Smuggling Queries at the Protocol Level
http://web.archive.org/web/20240812130923/https://media.defcon.org/DEF%20CON%2032/DEF%20CON%2032%20presentations/DEF%20CON%2032%20-%20Paul%20Gerste%20-%20SQL%20Injection%20Isn't%20Dead%20Smuggling%20Queries%20at%20the%20Protocol%20Level.pdf
(Archive link for posterity.)

Essentially, encoding a value larger than 4GiB can cause the length prefix in the protocol to overflow,
causing the server to interpret the rest of the string as binary protocol commands or other data.

It appears SQLx does perform truncating casts in a way that could be problematic,
for example: https://github.com/launchbadge/sqlx/blob/6f2905695b9606b5f51b40ce10af63ac9e696bb8/sqlx-postgres/src/arguments.rs#L163

This code has existed essentially since the beginning,
so it is reasonable to assume that all published versions <= 0.8.0 are affected.

Mitigation

As always, you should make sure your application is validating untrustworthy user input.
Reject any input over 4 GiB, or any input that could encode to a string longer than 4 GiB.
Dynamically built queries are also potentially problematic if it pushes the message size over this 4 GiB bound.

Encode::size_hint()
can be used for sanity checks, but do not assume that the size returned is accurate.
For example, the Json<T> and Text<T> adapters have no reasonable way to predict or estimate the final encoded size,
so they just return size_of::<T>() instead.

For web application backends, consider adding some middleware that limits the size of request bodies by default.

Resolution

Work has started on a branch to add #[deny] directives for the following Clippy lints:

and to manually audit the code that they flag.

A fix is expected to be included in the 0.8.1 release (still WIP as of writing).

Severity

Medium

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Oct 9, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from 13dba85 to f4b48d3 Compare October 9, 2024 08:33
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Oct 9, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from f4b48d3 to 3dd2a4b Compare October 9, 2024 10:58
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from 3dd2a4b to fb0248e Compare October 28, 2024 17:30
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Oct 28, 2024
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Oct 28, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch 2 times, most recently from e9b51f1 to a6915e6 Compare October 30, 2024 08:08
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Oct 30, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from a6915e6 to 2639986 Compare October 30, 2024 09:36
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Oct 30, 2024
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Nov 17, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch 2 times, most recently from 90b92e2 to a8411cf Compare November 17, 2024 18:18
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Nov 17, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from a8411cf to 194bc81 Compare November 20, 2024 20:42
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Nov 20, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from 194bc81 to 591c1ff Compare November 20, 2024 22:03
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Nov 20, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from 591c1ff to b215e4f Compare December 2, 2024 08:49
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Dec 2, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from b215e4f to 16a4fc2 Compare December 2, 2024 10:32
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Dec 2, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from 16a4fc2 to fd91513 Compare December 17, 2024 20:27
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Dec 17, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from fd91513 to 5fdb788 Compare December 17, 2024 23:35
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Dec 17, 2024
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from 5fdb788 to 3f81a9d Compare December 22, 2024 16:54
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Dec 22, 2024
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Feb 9, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from aa43dcb to b2e982f Compare February 9, 2025 16:58
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Feb 9, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from b2e982f to ba6d43a Compare March 3, 2025 17:39
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Mar 3, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from ba6d43a to c1d7a12 Compare March 3, 2025 23:08
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Mar 3, 2025
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Mar 11, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch 2 times, most recently from 2af3144 to 014309d Compare March 11, 2025 23:02
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Mar 11, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from 014309d to bedba8e Compare March 17, 2025 13:09
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Mar 17, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from bedba8e to f3cf2d1 Compare March 17, 2025 20:11
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Mar 17, 2025
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Apr 1, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch 2 times, most recently from 3d4816f to 74d03ce Compare April 1, 2025 19:45
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Apr 1, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from 74d03ce to e7176dd Compare April 8, 2025 12:59
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Apr 8, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from e7176dd to 8bf117f Compare April 8, 2025 19:19
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Apr 8, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from 8bf117f to d6fc4b8 Compare April 24, 2025 07:07
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] Apr 24, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from d6fc4b8 to deadbe4 Compare April 24, 2025 14:37
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8 [security] chore(deps): update rust crate sqlx to 0.8.1 [security] Apr 24, 2025
@renovate renovate Bot force-pushed the renovate/crate-sqlx-vulnerability branch from deadbe4 to 720f544 Compare May 7, 2025 10:59
@renovate renovate Bot changed the title chore(deps): update rust crate sqlx to 0.8.1 [security] chore(deps): update rust crate sqlx to 0.8 [security] May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants