; - 5: trace
; - 6: more detailed trace
;
+; Note: setting the pjproject debug level to 4 (debug) or above may result in
+; raw packets being logged. This should only be enabled during active debugging
+; to avoid a potential security issue due to logging injection.
+;
;asterisk_error = ; A comma separated list of pjproject log levels to map to
; Asterisk errors.
; (default: "0,1")
"\n"
" Set the maximum active pjproject logging level.\n"
" See pjproject.conf.sample for additional information\n"
- " about the various levels pjproject uses.\n";
+ " about the various levels pjproject uses.\n"
+ " Note: setting this level at 4 or above may result in\n"
+ " raw packet logging.\n";
return NULL;
case CLI_GENERATE:
return NULL;
--- /dev/null
+diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c
+index 4f483faa1..12439e3ee 100644
+--- a/pjsip/src/pjsip/sip_transport.c
++++ b/pjsip/src/pjsip/sip_transport.c
+@@ -2088,15 +2088,17 @@ PJ_DEF(pj_ssize_t) pjsip_tpmgr_receive_packet( pjsip_tpmgr *mgr,
+ * which were sent to keep NAT bindings.
+ */
+ if (tmp.slen) {
+- PJ_LOG(1, (THIS_FILE,
+- "Error processing %d bytes packet from %s %s:%d %.*s:\n"
+- "%.*s\n"
+- "-- end of packet.",
++ PJ_LOG(2, (THIS_FILE,
++ "Dropping %d bytes packet from %s %s:%d %.*s\n",
+ msg_fragment_size,
+ rdata->tp_info.transport->type_name,
+- rdata->pkt_info.src_name,
++ rdata->pkt_info.src_name,
+ rdata->pkt_info.src_port,
+- (int)tmp.slen, tmp.ptr,
++ (int)tmp.slen, tmp.ptr));
++ PJ_LOG(4, (THIS_FILE,
++ "Dropped packet:"
++ "%.*s\n"
++ "-- end of packet.",
+ (int)msg_fragment_size,
+ rdata->msg_info.msg_buf));
+ }