Repository navigation
Conversation
|
Hi @kalt2212, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
|
/assign @dinesh-murugiah @kalt2212 can you add a regression test? |
|
@kalt2212 , can you fix DCO per https://github.com/envoyproxy/envoy/pull/48177/checks?check_run_id=115288048455? Thank you |
Signed-off-by: Kalt2212 <adrimg3196@gmail.com>
A literal 'x' earlier in the token must not be mistaken for the hex-escape introducer. Requested by Kevin Baichoo. Signed-off-by: Kalt2212 <adrimg3196@gmail.com>
789c17e to
a6b5fff
Compare
yanavlasov
left a comment
There was a problem hiding this comment.
This will need to be converted to use absl::Status and remove exceptions.
|
@kalt2212 the spell checker had failed. https://github.com/envoyproxy/envoy/actions/runs/39706984100/job/119589284676#step:20:727 /wait |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
Hi @dinesh-murugiah @yanavlasov, quick status update: I'm currently refining the hex escape state tracking to cleanly handle edge cases with preceding literal characters (e.g. "xx\x41") and adding additional test coverage before pinging for the final review. Will push an update shortly. |
Signed-off-by: Adrian Martinez Garcia <adrimg3196@gmail.com>
Head branch was pushed to by a user without write access
Summary
Fixes an uncaught
std::invalid_argumentexception in the Redis inline command decoder (source/extensions/filters/network/common/redis/codec_impl.cc, stateInlineStringQuotedEscapeHex).Details
Commit f8f1768 added a bounds check before the hex-escape decode, but it is not sufficient:
s[s.size() - 3] == 'x'can match an'x'that is a literal character from earlier in the token rather than the escape introducer. Example trigger: the quoted inline token"xx\x41".In that case the two characters passed to
std::stoul(..., 16)are not hex digits, sostoulthrowsstd::invalid_argument. The decoder's callers only catchProtocolError, so the exception propagates out ofonDataand terminates the process — an unauthenticated remote crash.The patch validates both characters with
std::isxdigitbefore callingstoul, and throwsProtocolError("invalid hex escape in request")instead, which the existing machinery handles gracefully (connection closed, no crash).Testing
"xx\x41"(process terminated via uncaught exception before the patch).ProtocolErrorand the connection is closed cleanly.AI tool use disclosure: AI was used in part for code audit and patch drafting.