Forum dla administratorów stron WWW i developerów

Witaj!

AdminZone.pl to miejsce w którym możesz dowiedzieć się jak szybko i skutecznie wypromować swoją stronę WWW, zachęcić użytkowników do wypowiadania się i aktywnego udziału w życiu takiej strony.
Dołącz do naszej społeczności aby w pełni korzystać z usług oferowanych przez AdminZone.pl
Zaloguj się
lub
Zarejestruj się
 
Awatar użytkownika
Macsch15
Administrator
Posty: 1968
Rejestracja: 10 sie 2012, 16:12
Lokalizacja: Polska
Kontaktowanie:

Aktualizujcie git'a, CVE-2016-2324 i CVE‑2016‑2315

Autor tematu

16 mar 2016, 11:23

{l Image}

We wszystkich wersjach Git starszych niż 2.7.1 znajduje się błąd, który umożliwia nieświadomie wykonać kod na systemie podczas klonowania odpowiedniego repozytorium.

Błąd posiada dwa identyfikatory: CVE-2016-2324 i CVE‑2016‑2315 http://seclists.org/oss-sec/2016/q1/645
Fragment podatnego kodu:
// In revision.c before https://github.com/git/git/commit/34fa79a6cde56d6d428ab0d3160cb094ebad3305
char *path_name(const struct name_path *path, const char *name) // by design, name_path->len is a 32 bits int, but this doesn’t concern name
{
      const struct name_path *p;
      char *n, *m;
      int nlen = strlen(name); // the size is converted to a positive number (the correct size was allocated previously with an unsigned long). I got 705804100
      int len = nlen + 1;

      for (p = path; p; p = p->up) { //loop is skipped (except for the ᴄᴠᴇ-2016-2324 case which is fixed since 2.7.1 in February 2016)
          if (p->elem_len)
              len += p->elem_len + 1;
      }
      n = xmalloc(len); // if len is negative, it will also be converted to a negative 64 bits integer *(which explains it is normally trying to allocate serveral Pb of ram most of the time)* which will be read as positive after that. // but this isn’t the run case that is interesting here.
      m = n + len - (nlen + 1); // the size of m is lower than name
      strcpy(m, name); // strcpy rely on the null terminating character. The result is written in an unallocated memory from heap. This is the definition of heap overflow enabling server side remote code execution if name[] contains assembly, and have the correct size. This open the way to defeat canaries aslr, and nx combined see http://security.stackexchange.com/q/20497/36301#comment182004_20550
      for (p = path; p; p = p->up) {
          if (p->elem_len) {
              m -= p->elem_len + 1;
              memcpy(m, p->elem, p->elem_len);
              m[p->elem_len] = '/';
          }
      }
      return n;
}


Zalecana jest aktualizacja na serwerach jak w klientach.


Kto jest online

Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 34 gości