Plugin Directory

Changeset 3203397


Ignore:
Timestamp:
12/06/2024 06:43:41 AM (16 months ago)
Author:
karim42
Message:

fix: security patch for XSS vulnerability CVE-2024-11973

  • Added input validation and sanitization for sourate parameter
  • Improved security handling in template.php and functions_quran.php
  • Updated version to 2.3.22

This is a critical security update, all users should update immediately.

Location:
quran-text-multilanguage/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • quran-text-multilanguage/trunk/inc/functions_quran.php

    r2827902 r3203397  
    453453
    454454        if(recitator_quran == "Maheralmeaqly"){var nbr_quran = "<?php echo sprintf( "%03d", $sura );?>";}
    455         if(recitator_quran == "ElGhamidi"){var nbr_quran = "<?php echo $_GET['sourate'];?>"}
     455        if(recitator_quran == "ElGhamidi"){ var nbr_quran = "<?php echo esc_js(sanitize_text_field($_GET['sourate'] ?? '')); ?>";}
    456456        if(recitator_quran == "Soudais"){var nbr_quran = "<?php echo sprintf( "%03d", $sura );?>"}
    457457        if(recitator_quran == "Abdelbasset"){var nbr_quran = "<?php echo sprintf( "%03d", $sura );?>"}
  • quran-text-multilanguage/trunk/inc/template.php

    r3128827 r3203397  
    188188
    189189
    190     if(isset($_GET['sourate']) && isset($_GET['lang'])){
    191 
    192             preg_match("/[0-9]{1,3}$/", $_GET['sourate'], $matches);
    193 
     190    if(isset($_GET['sourate']) && isset($_GET['lang'])) {
     191        if(preg_match("/^([1-9]|[1-9][0-9]|1[0-1][0-4])$/", $_GET['sourate'], $matches)) {
    194192            $sura = $matches[0];
    195193            ?>
    196194            <script>
    197195            document.addEventListener('DOMContentLoaded', function() {
    198                 var sourate = "<?php echo $_GET['sourate']; ?>";
    199                 var lang = "<?php echo $_GET['lang']; ?>";
    200                 var UrlPrevSourate = "?sourate=" + sourate + "&lang=" + lang;
     196                var sourate = "<?php echo esc_js(sanitize_text_field($sura)); ?>";
     197                var lang = "<?php echo esc_js(sanitize_text_field($_GET['lang'] ?? '')); ?>";
     198                var UrlPrevSourate = "?sourate=" + encodeURIComponent(sourate) + "&lang=" + encodeURIComponent(lang);
    201199                history.pushState({ path: window.location.pathname }, '', UrlPrevSourate);
    202200            });
     
    204202            <div id="result">
    205203            <?php
    206             showSura($sura,$_GET['lang']);
    207 
     204            showSura($sura, $_GET['lang']);
     205            ?>
     206            </div>
     207            <?php
     208        } else {
     209            echo '<div class="error">Invalid surah number</div>';
     210        }
    208211    }
    209212
  • quran-text-multilanguage/trunk/quran-text-multilanguage.php

    r3128827 r3203397  
    77Description: Quran Text Multilanguage translated into 29 languages. Full ajax version and responsive. Fully customizable. More reciter...
    88
    9 Version: 2.3.21
    10 
     9Version: 2.3.22
     10* Important: This update includes critical security fixes
    1111Author: Bahmed karim
    1212
  • quran-text-multilanguage/trunk/readme.txt

    r3128827 r3203397  
    365365= 2.3.21
    366366 - fix json error api rest
     367
     368= 2.3.22 =
     369* Security: Critical security fix for XSS vulnerability in sourate parameter
     370* IMPORTANT: All users should update immediately
Note: See TracChangeset for help on using the changeset viewer.