Bug #24364
closed
Logs module unable to return non-ASCII characters
Added by Lukas Zapletal about 6 years ago.
Updated almost 6 years ago.
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>'
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/smart-proxy/pull/596 added
- Target version set to 890
- Status changed from Ready For Testing to Closed
- Pull request https://github.com/theforeman/smart-proxy/pull/597 added
- Pull request https://github.com/theforeman/smart-proxy/pull/598 added
- Fixed in Releases added
- Found in Releases 1.15.4 added
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.
- Bugzilla link set to 1615439
- 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 (
)
- Has duplicate Bug #24028: character conversion error when calling '/logs' on foreman-proxy added
- Target version deleted (
1.20.0)
Also available in: Atom
PDF