Skip to content

Fix/stream clients auth for https://github.com/luc-github/ESP3D/security/advisories/GHSA-fr7r-qv3v-233q - #1156

Draft
luc-github wants to merge 5 commits into
3.1from
fix/stream-clients-auth
Draft

luc-github wants to merge 5 commits into
3.1from
fix/stream-clients-auth

Conversation

@luc-github

Copy link
Copy Markdown
Owner

Authenticate stream clients and /ws, bump to 3.1.4
Stream clients (telnet, /wsdata, Bluetooth, USB CDC, serial bridge)
now require authentication when AUTHENTICATION_FEATURE is enabled:

  • a guest gets "error: authentication required" and nothing is
    forwarded to the machine; [ESP500] logs in and out per client
  • /wsdata: guests cannot read or write files over the binary protocol
  • /ws: the terminal socket follows the HTTP session (ESPSESSIONID)
    and stops receiving the output when that session is revoked
  • new stream session timeout ([ESP510]STREAM=, Stream_session_timeout
    in esp3dcnf.ini, 0 = no timeout); a transfer is closed when its
    session is lost

[ESP510]

  • syntax: HTTP= STREAM=; the old [ESP510] still sets
    the HTTP timeout
  • both values are checked before anything is written
  • JSON reply: {"HTTP":"x","STREAM":"y"}

Websocket protocol V1 alignment with ESP3D-X

  • /wsdata:
    • one welcome frame "Welcome to ESP3D V..."
    • TEXT frames are valid UTF-8: a split character is kept for the
      next frame, invalid bytes become '?'
    • empty lines are dropped, and '\r' ends a line
  • /ws:
    • PING: is read-only and reports the socket's own session
    • PONG: without authentication or with HTTP timeout 0
  • /command accepts PING=Yes, as sent by the WebUI

Other

  • ESP420: fix the build when SD_DEVICE is not ESP_SDIO
  • debug builds: version ends with "-DEBUG", and the firmware file
    is renamed
  • fix the Sesion_timeout typo in esp3dcnf.ini
  • docs: authentication, commands, websocket protocol
  • ws_transfer_test.py: authentication and the new welcome frame
  • Fix some typos
  • add esp32_s3_touch_lcd147 usb-cdc example implementation

Update ESP32 USB sanity check
Stream clients (telnet, /wsdata, Bluetooth, USB CDC, serial bridge)
now require authentication when AUTHENTICATION_FEATURE is enabled:
- a guest gets "error: authentication required" and nothing is
  forwarded to the machine; [ESP500] logs in and out per client
- /wsdata: guests cannot read or write files over the binary protocol
- /ws: the terminal socket follows the HTTP session (ESPSESSIONID)
  and stops receiving the output when that session is revoked
- new stream session timeout ([ESP510]STREAM=, Stream_session_timeout
  in esp3dcnf.ini, 0 = no timeout); a transfer is closed when its
  session is lost

[ESP510]
- syntax: HTTP=<min> STREAM=<min>; the old [ESP510]<min> still sets
  the HTTP timeout
- both values are checked before anything is written
- JSON reply: {"HTTP":"x","STREAM":"y"}

Websocket protocol V1 alignment with ESP3D-X
- /wsdata:
  - one welcome frame "Welcome to ESP3D V<version>..."
  - TEXT frames are valid UTF-8: a split character is kept for the
    next frame, invalid bytes become '?'
  - empty lines are dropped, and '\r' ends a line
- /ws:
  - PING: is read-only and reports the socket's own session
  - PONG:<millis> without authentication or with HTTP timeout 0
- /command accepts PING=Yes, as sent by the WebUI

Other
- ESP420: fix the build when SD_DEVICE is not ESP_SDIO
- debug builds: version ends with "-DEBUG", and the firmware file
  is renamed
- fix the Sesion_timeout typo in esp3dcnf.ini
- docs: authentication, commands, websocket protocol
- ws_transfer_test.py: authentication and the new welcome frame

This branch has not been deployed

No deployments
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.

1 participant