[GH-ISSUE #350] AP resets after sending malformed POST request. #2416

Closed
opened 2026-03-20 21:06:23 +01:00 by sascha_hemi · 6 comments
Owner

Originally created by @mukowman on GitHub (Jul 11, 2024).
Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/350

Originally assigned to: @nlimper on GitHub.

Testing out posting to save_cfg
I found if I miss some of the parameters like "alias" instead of returning a 400 error, the AP resets.

Originally created by @mukowman on GitHub (Jul 11, 2024). Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/350 Originally assigned to: @nlimper on GitHub. Testing out posting to save_cfg I found if I miss some of the parameters like "alias" instead of returning a 400 error, the AP resets.
sascha_hemi added the bug label 2026-03-20 21:06:23 +01:00
Author
Owner

@LeftPinkie commented on GitHub (Jul 16, 2024):

What is the env and version of your AP? What is the HTTP status code that you're getting. For example:

$ curl --json '{"mac":"0000021F7E3A3B15","rotate":"180"}' --write-out "\nhttp_code: %{http_code}\nexitcode: %{exitcode}\nerrormsg: %{errormsg}\nmethod: %{method}\n" http://10.10.10.50/save_cfg
Ok, saved
http_code: 200
exitcode: 0
errormsg: 
method: POST

I am using env: OpenEPaperLink_Mini_AP_v4, esp32 version: 2.60b and not able to reproduce this error.

<!-- gh-comment-id:2229535452 --> @LeftPinkie commented on GitHub (Jul 16, 2024): What is the env and version of your AP? What is the HTTP status code that you're getting. For example: ``` $ curl --json '{"mac":"0000021F7E3A3B15","rotate":"180"}' --write-out "\nhttp_code: %{http_code}\nexitcode: %{exitcode}\nerrormsg: %{errormsg}\nmethod: %{method}\n" http://10.10.10.50/save_cfg Ok, saved http_code: 200 exitcode: 0 errormsg: method: POST ``` I am using env: OpenEPaperLink_Mini_AP_v4, esp32 version: 2.60b and not able to reproduce this error.
Author
Owner

@mukowman commented on GitHub (Jul 16, 2024):

Oh interesting, I thought for sure would be easy to replicate.
With the post below, including alias I get 200.
If I uncheck alias I get no response then, I check the AP and it has rebooted.

env: ESP_THREAD_BORDER_ROUTER
build date: 2024-06-06 12:43
esp32 version: custom
psram size: 2092431
flash size: 4194304

Should be 2.60b

image

<!-- gh-comment-id:2229994021 --> @mukowman commented on GitHub (Jul 16, 2024): Oh interesting, I thought for sure would be easy to replicate. With the post below, including alias I get 200. If I uncheck alias I get no response then, I check the AP and it has rebooted. env: ESP_THREAD_BORDER_ROUTER build date: 2024-06-06 12:43 esp32 version: custom psram size: 2092431 flash size: 4194304 Should be 2.60b ![image](https://github.com/user-attachments/assets/baab165b-5179-4979-910f-33b1da41bd9e)
Author
Owner

@mukowman commented on GitHub (Jul 16, 2024):

image

<!-- gh-comment-id:2229995163 --> @mukowman commented on GitHub (Jul 16, 2024): ![image](https://github.com/user-attachments/assets/db77adf8-cbff-4d0a-a897-474fe1bac5e1)
Author
Owner

@LeftPinkie commented on GitHub (Jul 16, 2024):

Hmmm... not sure where the issue is as I cannot reproduce. What are the headers you are sending? Is it possible to use curl in the terminal?

<!-- gh-comment-id:2231833888 --> @LeftPinkie commented on GitHub (Jul 16, 2024): Hmmm... not sure where the issue is as I cannot reproduce. What are the headers you are sending? Is it possible to use `curl` in the terminal?
Author
Owner

@nlimper commented on GitHub (Sep 4, 2024):

See https://github.com/OpenEPaperLink/OpenEPaperLink/blob/master/ESP32_AP-Flasher/src/web.cpp#L348-L382
At least parameters mac, contentmode, alias en modecfgjson must be present. Their existence is assumed, and their contents are not sanitized any further. If you like, you can add some checks, but imho, it's not really beneficial.

<!-- gh-comment-id:2328238149 --> @nlimper commented on GitHub (Sep 4, 2024): See https://github.com/OpenEPaperLink/OpenEPaperLink/blob/master/ESP32_AP-Flasher/src/web.cpp#L348-L382 At least parameters `mac`, `contentmode`, `alias` en `modecfgjson` must be present. Their existence is assumed, and their contents are not sanitized any further. If you like, you can add some checks, but imho, it's not really beneficial.
Author
Owner

@nlimper commented on GitHub (Oct 28, 2024):

fixed in 5e9238835e
contentmode, alias and modecfgjson are now optional.

<!-- gh-comment-id:2441262264 --> @nlimper commented on GitHub (Oct 28, 2024): fixed in https://github.com/OpenEPaperLink/OpenEPaperLink/commit/5e9238835e7b30e0d468a9f5fca919d5f84de0ff `contentmode`, `alias` and `modecfgjson` are now optional.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/OpenEPaperLink#2416