Skip to content

Conversation

@labkey-nicka
Copy link
Contributor

@labkey-nicka labkey-nicka commented Sep 11, 2025

Rationale

Certain "special" characters (e.g., " ; = , \) can cause issues when not escaped in multipart/form-data in Tomcat. For example, the "name" of the property is extracted from:

form-data; name="field\"; filename="spread.xlsx";

is expected to be field\, however, it is parsed as field\"; filename="spread.xlsx"; because the backlash is recognized as escaping the " after field\. The fix is to escape the backslash like this:

form-data; name="field\\"; filename="spread.xlsx";

Unfortunately, it is not clear to me why we need to do this as it seems like the standard states that as long as the string is quoted (e.g., name"field\"; not name=field\;) which appears to be what we are receiving. This fix is currently targeted only for QueryUpdateForm which is used for our standard query insert/update forms.

Related Pull Requests

Changes

  • Update QueryUpdateForm.getFormFieldName() and getColumnByFormFieldName() to escape and account for special characters in form field names.
  • Update QueryUpdateForm.getMultiPartFormFieldName() to make use of getFormFieldName() to get appropriate escaping.
  • Update tests to use EscapeUtils.getFormFieldName().
  • Add explicit regression test coverage.

Tasks 📍

@labkey-nicka labkey-nicka merged commit ff843f6 into develop Sep 16, 2025
22 checks passed
@labkey-nicka labkey-nicka deleted the fb_form_backslash branch September 16, 2025 00:25
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.

3 participants