Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: █ █ Aggiornamento Coppermine 1.4.21 █ █  (Read 5408 times)

0 Members and 1 Guest are viewing this topic.

Davide Renda

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
█ █ Aggiornamento Coppermine 1.4.21 █ █
« on: March 05, 2009, 02:12:44 pm »

Il gruppo di sviluppo Coppermine ha rilasciato un aggiornamento di sicurezza per colmare una vulnerabilità recentemente scoperta. È importante che chiunque utilizzi una versione 1.4.20 (o, peggio, precedente) aggiorni al più presto all'ultima versione.

Come aggiornare:
Gli utenti delle versioni precedenti alla 1.4.21 devono aggiornare immediatamente scaricando l'ultima versione dalla pagina download e seguendo le istruzioni dalla documentazione.  Chi lo desiderasse potrà invece applicare la patch manualmente seguendo le istruzioni nel messaggio seguente.

Supporto:
Se incontrate problemi con questo aggiornamento, aprite liberamente una discussione in questa sezione in Italiano.

Perché del rilascio della versione 1.4.21
Questa versione colma una vulnerabilità recentemente scoperta che permetterebbe ad un utente di lanciare un attacco CSRF (definizione) contro il vostro sito (milw0rm exploit 8114 e 8115). La possibile vulnerabilità è dovuto al processo dei tags bbcode [ i m g ] and [ u r l ]. L'attacco può essere lanciato attraverso questi tags e raggiungere l'intero sito; tutti gli amministratori di gallerie Coppermine devono agire immediatamente.
Dato che CPG 1.4.x è una versione stabile del pacchetto, il dev-team non può risolvere questa vulnerabilità senza dover pesantemente metter mano al codice, quindi la soluzione è stata di rimuovere il processo dei due tags bbcode [ i m g ] and [ u r l ]
Questa non sarà la soluzione finale, ma è necessaria per colmare la vulnerabilità. Il dev-team Coppermine sta attualmente lavorando su come risolvere il problema a fondo e presto i risultati saranno disponibili. Chi vuole potrà avere ulteriori informazioni su come vengano processati i tags e/o come trovare la propria soluzione nella sezione bbcode della documentazione.

In aggiunta alla patch, la versione 1.4.21 include anche altri fix che non hanno a che vedere con la sicurezza. Il file whatsnew disponibile nel pacchetto.
Grazie a StAkeR alla milw0rm che ha scoperto la possibile vulnerabilità.

Coppermine Team

Davide Renda

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
Re: █ █ Aggiornamento Coppermine 1.4.21 █ █
« Reply #1 on: March 05, 2009, 02:15:45 pm »

Chi lo desidera (e qui penso agli utenti del Modpack di Stramm) potrà applicare il patch alla vulnerabilità direttamente. Questo risolverà solamente il problema serio di sicurezza, ma non aggiornerà la galleria all'ultima versione.

Rimpiazzate la funzione bb_decode nel file include/functions.inc.php col seguente codice:
Code: [Select]
// Allow the use of a limited set of phpBB bb codes in albums and image descriptions
// Based on phpBB code

/**
 * bb_decode()
 *
 * @param $text
 * @return
 **/

function bb_decode($text)
{
    $text = nl2br($text);

    static $bbcode_tpl = array();
    static $patterns = array();
    static $replacements = array();

    // First: If there isn't a "[" and a "]" in the message, don't bother.
    if ((strpos($text, "[") === false || strpos($text, "]") === false)) {
        return $text;
    }

    // [b] and [/b] for bolding text.
    $text = str_replace("[b]", '<b>', $text);
    $text = str_replace("[/b]", '</b>', $text);

    // [u] and [/u] for underlining text.
    $text = str_replace("[u]", '<u>', $text);
    $text = str_replace("[/u]", '</u>', $text);

    // [i] and [/i] for italicizing text.
    $text = str_replace("[i]", '<i>', $text);
    $text = str_replace("[/i]", '</i>', $text);

    // colors
    $text = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+)\]/", '<span style="color:$1">', $text);
    $text = str_replace("[/color]", '</span>', $text);

    // [i] and [/i] for italicizing text.
    //$text = str_replace("[i:$uid]", $bbcode_tpl['i_open'], $text);
    //$text = str_replace("[/i:$uid]", $bbcode_tpl['i_close'], $text);

    if (!count($bbcode_tpl)) {
        // We do URLs in several different ways..
       
        // **** WARNING *******************************************************
        // The [url] tag can be used for a serious attack against your website.
        // So [url] tags are no longer processed to show links.
        // This simple action here is not an ideal solution but is necessary.
        // Now, [url] tags are processed as follows:
        // [url=link]text[/url] shows 'text' with a dummy image for the link.
        // [url]link[/url] shows 'link' as plain text with a dummy image.
        // The following line is the original line that processed [url]:
        // $bbcode_tpl['url']  = '<span class="bblink"><a href="{URL}" rel="external">{DESCRIPTION}</a></span>';
        // ********************************************************************
        // See this thread on the Coppermine forum for more information:
        // http://forum.coppermine-gallery.net/index.php/topic,58309.0.html
        // Please read this thread carefully before deciding to process [url].
        // ********************************************************************
        $url_removed = '{URL}';  // put the image URL in the tooltip/mouse-over
        $bbcode_tpl['url']   = '{DESCRIPTION}<img src="images/descending.gif" alt="" title="' . $url_removed . '" />';
        $bbcode_tpl['email'] = '<span class="bblink"><a href="mailto:{EMAIL}">{EMAIL}</a></span>';

        $bbcode_tpl['url1'] = str_replace('{URL}', '\\1\\2', $bbcode_tpl['url']);
        $bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1\\2', $bbcode_tpl['url1']);

        $bbcode_tpl['url2'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);
        $bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']);

        $bbcode_tpl['url3'] = str_replace('{URL}', '\\1\\2', $bbcode_tpl['url']);
        $bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url3']);

        $bbcode_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);
        $bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url4']);

        $bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);

        // [url]xxxx://www.phpbb.com[/url] code..
        $patterns[1] = "#\[url\]([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\[/url\]#si";
        $replacements[1] = $bbcode_tpl['url1'];

        // [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
        $patterns[2] = "#\[url\]([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\[/url\]#si";
        $replacements[2] = $bbcode_tpl['url2'];

        // [url=xxxx://www.phpbb.com]phpBB[/url] code..
        $patterns[3] = "#\[url=([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\](.*?)\[/url\]#si";
        $replacements[3] = $bbcode_tpl['url3'];

        // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
        $patterns[4] = "#\[url=([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\](.*?)\[/url\]#si";
        $replacements[4] = $bbcode_tpl['url4'];

        // [email]user@domain.tld[/email] code..
        $patterns[5] = "#\[email\]([a-z0-9\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
        $replacements[5] = $bbcode_tpl['email'];

        // [img]xxxx://www.phpbb.com[/img] code..
        // **** WARNING *******************************************************
        // The [img] tag can be used for a serious attack against your website.
        // So [img] tags are no longer processed to show the specified images.
        // This simple action here is not an ideal solution but is necessary.
        // Now [img] tags will show a dummy image instead as a placeholder.
        // ********************************************************************
        // The following line is the original line that processed [img]:
        // $bbcode_tpl['img'] = '<img src="{URL}" alt="" />';
        // ********************************************************************
        // See this thread on the Coppermine forum for more information:
        // http://forum.coppermine-gallery.net/index.php/topic,58309.0.html
        // Please read this thread carefully before deciding to process [img].
        // ********************************************************************
        $img_removed = '{URL}';  // put the image URL in the tooltip/mouse-over
        $bbcode_tpl['img'] = '<img src="images/thumbnails.gif" alt="" title="' . $img_removed . '" />';
        $bbcode_tpl['img'] = str_replace('{URL}', '\\1\\2', $bbcode_tpl['img']);
        $patterns[6] = "#\[img\]([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\[/img\]#si";
        $replacements[6] = $bbcode_tpl['img'];
    }
    $text = preg_replace($patterns, $replacements, $text);
    return $text;
}

Davide Renda

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
Re: █ █ Aggiornamento Coppermine 1.4.21 █ █
« Reply #2 on: March 05, 2009, 02:25:06 pm »

Joachim Müller, inoltre, ci tiene a specificare i seguenti punti:
  • È obbligatorio aggiornare. Il gallery admin non deve starsene seduto ad aspettare che la sua galleria venga attaccata solo perché non vuole aggiornare di nuovo. Pulire e ristabilire una galleria attaccata è più difficile e lungo che fare frequenti aggiornamenti e backup quando necessario.
  • Aggiornare alla 1.4.21 disabiliterà due funzioni: il gallery admin, i suoi utenti ed i visitatori non potranno più utilizzare tags bbcode[ i m g ] e [ u r l ] nei commenti e nelle descrizioni. Se non avete mai usato questa possibilità, bene, non vi mancherà nulla. Coloro i quali invece usano il bbcode dovranno capire che non aggiornare per non perdere una feature non è un'opzione da tenere da conto.
  • Al momento non sono stati ancora segnalati exploit su galleria utilizzando la vulnerabilità scoperta. Potrete comunque essere certi che questo avverrà a breve, magari mentre stiamo leggendo questo messaggio, un attacco è in atto. Aggiornate adesso!
  • Se la vostra galleria è vittima di un attacco utilizzando questo exploit (o altri, scoperti nelle precedenti versioni), seguite le istruzioni di ripristino spiegate nel thread "Yikes, I've been hacked! Now what?". Aggiornare dopo essere stati attaccati non basta!

Davide Renda

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
Re: █ █ Aggiornamento Coppermine 1.4.21 █ █
« Reply #3 on: March 10, 2009, 09:46:12 am »

Anche il Modpack è disponibile per l'aggiornamento alla 1.4.21.
Download da Stramm's Sandbox
Download dal mirror Sourceforge
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.