Skip Menu |

This queue is for tickets about the Socket CPAN distribution.

Report information
The Basics
Id: 122830
Status: resolved
Priority: 0/
Queue: Socket

People
Owner: Nobody in particular
Requestors: pali [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.026



Subject: Insecure implementation of the croak_sv
Current implementation in perlblead cpan/Socket/Socket.xs file is: #ifndef croak_sv # define croak_sv(sv) croak(SvPVx_nolen(sv)) #endif But function croak is variadic which expects as a first parameter printf-style format. Passing arbitrary and string from the caller as a printf format leads to the security problem CWE-134: Use of Externally-Controlled Format String. But croak_sv is not used at all, so rather remove this insecure implementation.
On Thu Aug 17 03:42:40 2017, PALI wrote: Show quoted text
> But croak_sv is not used at all, so rather remove this insecure > implementation.
Technically since the macro isn't even expanded, it doesn't get used at all in the source so it never appears. But I agree, since it isn't used and it's not a good implementation even if it was used, I've deleted it. Will be (absent) in 2.026 -- Paul Evans
Subject: rt122830.patch
=== modified file 'Socket.xs' --- Socket.xs 2018-01-11 22:40:33 +0000 +++ Socket.xs 2018-01-11 22:58:10 +0000 @@ -186,10 +186,6 @@ #endif /* __GNU__ */ #endif /* !SvPVx_nolen */ -#ifndef croak_sv -# define croak_sv(sv) croak(SvPVx_nolen(sv)) -#endif - #ifndef hv_stores # define hv_stores(hv, keystr, val) \ hv_store(hv, ""keystr"", sizeof(keystr)-1, val, 0)
Released -- Paul Evans