Skip to content

handling non-standard post data format with filtering #5599

@MeredithAnya

Description

@MeredithAnya

Sending post data in either JSON or urlencoded formats will correctly filter sensitive data through filter_http (code here).

However, something like a JSON serialized string representing the data gets mutated awkwardly:

{'data': '"{"meredith":{"first_name":"gosh","last_name":"darn"},"commit":"Save Meredith","authenticity_token":"HyhO0Ut+vb6QeZ2f1HadNu1MsNctx7HiA/q5mIWYqA81MctGBCw0ZYEIsI84K+USqcLdx6yHsdpCFViOYqlwPw="}"'}

becomes

{'data': '"{"meredith":{"first_name":"gosh","last_name":"darn"},"commit":"Save Meredith","authenticity_token":"HyhO0Ut+vb6QeZ2f1HadNu1MsNctx7HiA/q5mIWYqA81MctGBCw0ZYEIsI84K+USqcLdx6yHsdpCFViOYqlwPw=[Filtered]'}

Not only does this not filter the authenticity_token correctly, it also cuts off a trailing } which causes problems in the UI in rendering the post data.

note: this example fails because of the single =

cc @tkaemming

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions