Skip to content

Corrupting values in parameters: application responsibility? #1759

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

Closed
bodawei opened this issue Nov 27, 2018 · 3 comments
Closed

Corrupting values in parameters: application responsibility? #1759

bodawei opened this issue Nov 27, 2018 · 3 comments
Labels
clarification requests to clarify, but not change, part of the spec param serialization Issues related to parameter and/or header serialization review

Comments

@bodawei
Copy link

bodawei commented Nov 27, 2018

It isn't clear from the spec how these cases should be handled when building a request to be sent.

  1. a header parameter that has "\r\n" in its value
  2. a cookie with ";" in its value
  3. a spaceDelimited value that has " " in it
  4. a pipeDelimited value that has "|" in it
  5. a label value with a "." in it
  6. a matrix, form, or simple styled non-exploded value with "," in its values

I assume that OAS has no way to protect an app from itself in these circumstances, and so it is the responsibility of the app not to send data like this in these cases, or for an OAS client library to report an error if it is asked to do so.

(in terms of protecting an app from itself, cases like a path parameter which has "?" in its value and a query parameter that has "&" in its value can be dealt with by percent encoding these values before inserting into the URL)

@MikeRalphson
Copy link
Member

I think it should be "must be dealt with by percent encoding" for components of the URL. But I see a possible need to forbid in the spec some of your enumerated problems above (such as the pipes one).

@bodawei
Copy link
Author

bodawei commented Oct 20, 2019

FWIW, I've come to see that the percent encoding aspect for many of these isn't actually a pragmatic solution. Usually, at least, a query parameter value is simply "decodeURIComponent()"'ed, and that won't be able to distinguish between a delimiter that is percent encoded and a bit of data that is percent encoded. I think this forces either disallowing or an application-specific layer of additional decoding. :-(

@handrews handrews added clarification requests to clarify, but not change, part of the spec param serialization Issues related to parameter and/or header serialization labels Jan 28, 2024
@handrews
Copy link
Member

The parts of this that we can deal with are being handled in the following (which address all delimiter confusion, not just spaces).

Since this basically answers the question of this issue with a "yes, it's the application / user responsibility", I'm going to close this as a duplicate. If you think there's something else here, please comment and we can re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification requests to clarify, but not change, part of the spec param serialization Issues related to parameter and/or header serialization review
Projects
None yet
Development

No branches or pull requests

3 participants