You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "bryancall (via GitHub)" <gi...@apache.org> on 2026/03/23 17:23:09 UTC

[PR] Fix ASAN-detected plugin bugs across five components [trafficserver]

bryancall opened a new pull request, #13013:
URL: https://github.com/apache/trafficserver/pull/13013

   ## Summary
   - Fix five ASAN-detected defects in plugin/test-plugin code paths: heap buffer read, delete type mismatch, use-after-free, and leak on early return.
   - Update `stats_over_http`, `ja4_fingerprint`, `txn_box`, `slice`, and `async_engine` with targeted correctness fixes.
   - Keep changes scoped and independent so plugin safety fixes can merge early.
   
   ## Test plan
   - [x] Reproduce and validate fixes in ASAN test runs from the flaky/ASAN audit effort.
   - [x] Confirm each fix is limited to the failing code path in the affected plugin.
   - [ ] Run Apache CI suite for full platform/compiler coverage.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix ASAN-detected plugin bugs across five components [trafficserver]

Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall commented on code in PR #13013:
URL: https://github.com/apache/trafficserver/pull/13013#discussion_r2981991017


##########
plugins/experimental/ja4_fingerprint/plugin.cc:
##########
@@ -444,7 +444,7 @@ handle_vconn_close(TSCont /* cont ATS_UNUSED */, TSEvent event, void *edata)
     return TS_SUCCESS;
   }
   TSVConn const ssl_vc{static_cast<TSVConn>(edata)};
-  delete static_cast<std::string *>(TSUserArgGet(ssl_vc, *get_user_arg_index()));
+  delete static_cast<JA4_data *>(TSUserArgGet(ssl_vc, *get_user_arg_index()));
   TSUserArgSet(ssl_vc, *get_user_arg_index(), nullptr);

Review Comment:
   Fixed — handle_read_request_hdr now retrieves JA4_data* and passes &data->fingerprint to append_JA4_headers. Addressed in latest commit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix ASAN-detected plugin bugs across five components [trafficserver]

Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall merged PR #13013:
URL: https://github.com/apache/trafficserver/pull/13013


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix ASAN-detected plugin bugs across five components [trafficserver]

Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall commented on PR #13013:
URL: https://github.com/apache/trafficserver/pull/13013#issuecomment-4139425330

   Friendly ping @moonchen -- this is a straightforward set of ASAN fixes across five plugins (heap buffer read, delete type mismatch, use-after-free, leak). Each fix is isolated to the affected code path. Would appreciate a review when you get a chance.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix ASAN-detected plugin bugs across five components [trafficserver]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13013:
URL: https://github.com/apache/trafficserver/pull/13013#discussion_r2976621778


##########
plugins/experimental/ja4_fingerprint/plugin.cc:
##########
@@ -444,7 +444,7 @@ handle_vconn_close(TSCont /* cont ATS_UNUSED */, TSEvent event, void *edata)
     return TS_SUCCESS;
   }
   TSVConn const ssl_vc{static_cast<TSVConn>(edata)};
-  delete static_cast<std::string *>(TSUserArgGet(ssl_vc, *get_user_arg_index()));
+  delete static_cast<JA4_data *>(TSUserArgGet(ssl_vc, *get_user_arg_index()));
   TSUserArgSet(ssl_vc, *get_user_arg_index(), nullptr);

Review Comment:
   TSUserArgSet() stores a JA4_data* (see handle_client_hello), and this change updates the VCONN_CLOSE cleanup accordingly. However, handle_read_request_hdr still retrieves the same user arg as std::string*, so it will reinterpret a JA4_data object as a std::string and can crash or read invalid memory. Update the read-request hook to fetch JA4_data* (or store only a std::string* consistently) and pass/use the fingerprint member accordingly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org