Skip to content

πŸ”’οΈ Validate and send STORE attr as an atom#658

Merged
nevans merged 1 commit into
masterfrom
security/store-attr-validation
Apr 23, 2026
Merged

πŸ”’οΈ Validate and send STORE attr as an atom#658
nevans merged 1 commit into
masterfrom
security/store-attr-validation

Conversation

@nevans
Copy link
Copy Markdown
Collaborator

@nevans nevans commented Apr 23, 2026 β€’

Important

This fixes a CRLF/command/argument injection vulnerability for the attr argument to #store/#uid_store.

Previously, #store and #uid_store wrapped attr with RawData. But that's completely unnecessary. +, -, and . are atom chars, and every STORE "message data item" defined in any RFC is an atom:

 FLAGS      FLAGS.SILENT
+FLAGS     +FLAGS.SILENT
-FLAGS     -FLAGS.SILENT
ANNOTATION ANNOTATION.SILENT

We can revisit this in the future, if some new extension uses a non-atom for its STORE "message data item", but that seems unlikely.

Note also that Atom is only applied to String arguments.

@nevans nevans added bug Something isn't working backport-0.5 This ticket needs to be backported to the v0.5-stable branch. backport-0.4 This ticket needs to be backported to the v0.4-stable branch labels Apr 23, 2026
@nevans nevans changed the title πŸ₯… Validate and send STORE attr as an atom πŸ”’οΈ Validate and send STORE attr as an atom Apr 23, 2026
Base automatically changed from strict-atom-flag-command-arg-validation to master April 23, 2026 13:57
Previously, `#store` and `#uid_store` wrapped `attr` with `RawData`.
But that's completely unnecessary.  `+`, `-`, and `.` are atom chars,
and every STORE "message data item" defined in any RFC is an `atom`:

```
 FLAGS      FLAGS.SILENT
+FLAGS     +FLAGS.SILENT
-FLAGS     -FLAGS.SILENT
ANNOTATION ANNOTATION.SILENT
```

We can revisit this in the future, if some new extension uses a non-atom
for its STORE "message data item", but that seems unlikely.

Note also that `Atom` is only applied to `String` arguments.
@nevans nevans force-pushed the security/store-attr-validation branch from 27d3a2e to be87c7b Compare April 23, 2026 13:59
@nevans nevans merged commit a4f7649 into master Apr 23, 2026
39 checks passed
@nevans nevans deleted the security/store-attr-validation branch April 23, 2026 14:13
@nevans nevans added the security vulnerability patch Pull requests that address security vulnerabilities label Apr 23, 2026
nevans added a commit that referenced this pull request Apr 23, 2026
Now that fixes for `setquota` (#659), `store`/`uid_store` (#658) have
been merged, there should only be two parameters that still use
`RawData`: search `criteria` and fetch `attr` (and the `UID` variants).

`#search` criteria (when a string) had already been documented, but this
aspect of `#fetch` attr was _not_ previously documented!
nevans added a commit that referenced this pull request Apr 23, 2026
Now that fixes for `setquota` (#659), `store`/`uid_store` (#658) have
been merged, there should only be two parameters that still use
`RawData`: search `criteria` and fetch `attr` (and the `UID` variants).

`#search` criteria (when a string) had already been documented, but this
aspect of `#fetch` attr was _not_ previously documented!
nevans added a commit that referenced this pull request Apr 23, 2026
πŸ”’ Fix CRLF injection vulnerabilities (backports #657, #658, #659, #660, #636, #661)
nevans added a commit that referenced this pull request Apr 23, 2026
πŸ”’ Fix CRLF injection vulnerabilities (backports #657, #658, #659, #660, #636, #661)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-0.4 This ticket needs to be backported to the v0.4-stable branch backport-0.5 This ticket needs to be backported to the v0.5-stable branch. bug Something isn't working security vulnerability patch Pull requests that address security vulnerabilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant