1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2026-06-03 21:45:48 +00:00
Adam Cooke 4314a6ec1e fix(message-db): prevent SQL injection via condition keys (GHSA-x2hq-rfpg-3xr5)
The Legacy API message lookup endpoints parsed the request body as JSON and
passed the `id` parameter straight through to the message database. A JSON
object supplied for `id` arrived as a Ruby Hash and was used as a raw set of
SQL `WHERE` conditions. `hash_to_sql` interpolated each Hash key directly
inside backtick identifier quoting while escaping only the value, so a key
containing a backtick could break out of the identifier and inject arbitrary
SQL into the SELECT (blind, time-based) against the message database.

Fixes:

- Escape all identifiers (columns, tables, database names) through a new
  `escape_identifier` helper that wraps in backticks and doubles embedded
  backticks. Applied across hash_to_sql, select, insert, insert_multi,
  update and delete so no caller can inject via an identifier.
- Validate the Legacy API `id` parameter at the controller boundary: reject
  any non-scalar value before it reaches the database and coerce it to an
  integer. Internal Hash-based lookups (e.g. tracking middleware) are
  unaffected.

Adds regression tests at the unit (hash_to_sql / escape_identifier) and
request (legacy messages/deliveries) levels.
2026-06-03 15:06:35 +01:00
2024-03-04 21:01:31 +00:00
2024-03-12 17:40:07 +00:00
2017-04-19 13:07:25 +01:00
2017-04-19 13:07:25 +01:00
2024-06-20 14:27:18 +01:00
2017-04-19 13:07:25 +01:00
2017-04-19 13:07:25 +01:00
2025-10-02 14:39:27 +01:00
2024-03-04 13:48:33 +00:00
2024-03-04 14:28:04 +00:00

GitHub Header

Postal is a complete and fully featured mail server for use by websites & web servers. Think Sendgrid, Mailgun or Postmark but open source and ready for you to run on your own servers.

الوصف
📮 A fully featured open source mail delivery platform for incoming & outgoing e-mail
اقرأني 6 MiB
اللغات
Ruby 71.6%
Haml 14.4%
omnetpp-msg 6.1%
SCSS 5.8%
CoffeeScript 0.8%
أخرى 1.3%