French Character Encoding

255 views
Skip to first unread message

Hector Luna

unread,
Apr 17, 2023, 2:53:20 PM4/17/23
to OWASP ZAP User Group
I am having issues with trying to post a request using Zest.

I am trying to post a json object that contains something like this in it:

"fr": {
"translation": {
"balanced": "Équilibré"
}
}

However, the issue has to do with the special French characters. The same request works fine in JMeter, and via postman, and even if I use the "Requester" tab in ZAP UI but it will not work at all as request in a zest script.

This is what the ZAP logs show as part of the request when running from a zest script:
2023-04-17 13:37:35,907 [ZAP-IO-EventExecutor-3-6] DEBUG wire - http-outgoing-1473 >> " "fr": {[\n]"
2023-04-17 13:37:35,907 [ZAP-IO-EventExecutor-3-6] DEBUG wire - http-outgoing-1473 >> " "translation": {[\n]"
2023-04-17 13:37:35,907 [ZAP-IO-EventExecutor-3-6] DEBUG wire - http-outgoing-1473 >> " "balanced": "[0xffffffc9]quilibr[0xffffffe9]",[\n]"
2023-04-17 13:37:35,907 [ZAP-IO-EventExecutor-3-6] DEBUG wire - http-outgoing-1473 >> " }[\n]"
2023-04-17 13:37:35,907 [ZAP-IO-EventExecutor-3-6] DEBUG wire - http-outgoing-1473 >> " }[\n]"

This is what the ZAP logs show when I run it via the Requester.
2023-04-17 13:45:57,108 [Thread-7590] DEBUG wire - http-outgoing-1488 >> " "fr": {[\n]"
2023-04-17 13:45:57,108 [Thread-7590] DEBUG wire - http-outgoing-1488 >> " "translation": {[\n]"
2023-04-17 13:45:57,108 [Thread-7590] DEBUG wire - http-outgoing-1488 >> " "balanced": "[0xffffffc3][0xffffff89]quilibr[0xffffffc3][0xffffffa9]",[\n]"
2023-04-17 13:45:57,108 [Thread-7590] DEBUG wire - http-outgoing-1488 >> " }[\n]"
2023-04-17 13:45:57,108 [Thread-7590] DEBUG wire - http-outgoing-1488 >> " }[\n]"

The requester scenario requires the following header to work:
Content-Type: application/json; charset=utf-8

Other tools like JMeter and Postman work with the header as follows:
Content-Type: application/json; charset=utf-8

I am curious about what I am doing wrong? I know it isn't a configuration issue because removing the French characters makes the request work every time, so I am thinking there is something that ZAP doesn't like about having those characters there.

Thank you in advance!

Hector Luna

unread,
Apr 17, 2023, 2:55:40 PM4/17/23
to OWASP ZAP User Group
Opps, the content type header I use in other tools is as follows (no need to specify UTF-8):
Content-Type: application/json

thc...@gmail.com

unread,
Apr 17, 2023, 3:05:45 PM4/17/23
to zaprox...@googlegroups.com
Hi.

If I'm understanding correctly that's probably:
https://github.com/zaproxy/zaproxy/issues/6656

I think this can now be fixed in the add-on, will take a look…

Best regards.

Hector Luna

unread,
Apr 17, 2023, 3:09:01 PM4/17/23
to OWASP ZAP User Group
Yay! Thank you sir. I was going crazy thinking I was doing something I wasn't supposed to.
Reply all
Reply to author
Forward
0 new messages