Bug #24364
closedLogs module unable to return non-ASCII characters
Description
1) Start a proxy (upstream develop branch is affected as well):
2) Have "logs" module enabled
3) Send arbitrary binary data via TCP plain connection to HTTP endpoint: nc localhost 8448 < /usr/bin/bash
4) Call logs API: curl-proxy /logs
D, [2018-07-24T09:58:14.814774 ] DEBUG -- : "\xB0" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
/home/lzap/work/smart-proxy/modules/logs/logs_api.rb:15:in `encode'
/home/lzap/work/smart-proxy/modules/logs/logs_api.rb:15:in `to_json'
/home/lzap/work/smart-proxy/modules/logs/logs_api.rb:15:in `block in <class:LogsApi>'
Updated by The Foreman Bot about 6 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/smart-proxy/pull/596 added
Updated by Lukas Zapletal about 6 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 4f09154e3ca164eea8dbbcbfc2ee803db4d8deab.
Updated by The Foreman Bot about 6 years ago
- Pull request https://github.com/theforeman/smart-proxy/pull/597 added
Updated by The Foreman Bot about 6 years ago
- Pull request https://github.com/theforeman/smart-proxy/pull/598 added
Updated by Lukas Zapletal about 6 years ago
- Fixed in Releases added
- Found in Releases 1.15.4 added
Updated by Lukas Zapletal about 6 years ago
For Katello there are some steps required in order to reproduce:
1) Make sure that HTTP endpoint is enabled (to do that install templates plugin):
:http_port: 8000
2) Send some UTF-8 decoder unfriendly data TO PORT 8000 (not 9090 that's HTTPS and the stack will refuse to pass this into the app)
nc localhost 8000 < /usr/bin/bash
3) Then access logs remotely:
- curl -s --cert /etc/foreman/client_cert.pem --key /etc/foreman/client_key.pem --cacert /etc/foreman/proxy_ca.pem https://$(hostname):9090/logs
"\xE1" from ASCII-8BIT to UTF-8
Formatting is slightly different but apparently the bug is there. When you turn on DEBUG the message will be pretty clear.
Updated by Ewoud Kohl van Wijngaarden about 6 years ago
- Target version changed from 890 to 1.20.0
- Fixed in Releases 1.18.1, 1.19.0, 1.20.0 added
- Fixed in Releases deleted (
)
Updated by Ivan Necas almost 6 years ago
- Has duplicate Bug #24028: character conversion error when calling '/logs' on foreman-proxy added