[ CVE-2022-1582 ] Wordpress External Links in New Window Analysis

2023. 10. 5. 11:38·💻 Security

Description

Vulenerable Version : < 1.43

 

"External Links in New Window" is one of wordpress plugin that let user set URLS which should either be forced to open in a new window or ignored it. 

 

CVE-2022-1482 is a (unauthenticated) Stored XSS vulnerability in external new tab, a plugin in wordpress because it doesn't escape URLs appropriately so it concatenates to onclick event handlers.

 

    function admin_footer()
    {
      if (false === $this->is_plugin_screen()) {
        return;
      }

      $out = '';
      $icons_url = plugin_dir_url($this->plugin_file) . 'wf-flyout/icons/';
      $default_link_item = array('class' => '', 'href' => '#', 'target' => '_blank', 'label' => '', 'icon' => '');

      $out .= '<div id="wff-overlay"></div>';

      $out .= '<div id="wf-flyout">';

      $out .= '<a href="#" id="wff-button">';
      $out .= '<span class="wff-label">Open Quick Links</span>';
      $out .= '<span id="wff-image-wrapper">';
      $out .= '<img src="' . $icons_url . $this->config['icon_image'] . '" alt="Open Quick Links" title="Open Quick Links">';
      $out .= '</span>';
      $out .= '</a>';

      $out .= '<div id="wff-menu">';
      $i = 0;
      foreach (array_reverse($this->config['menu_items']) as $item) {
        $i++;
        $item = array_merge($default_link_item, $item);

        if (!empty($item['icon']) && substr($item['icon'], 0, 9) != 'dashicons') {
          $item['class'] .= ' wff-custom-icon';
          $item['class'] = trim($item['class']);
        }

        $out .= '<a href="' . $item['href'] . '" class="wff-menu-item wff-menu-item-' . $i . ' ' . $item['class'] . '" target="_blank">';
        $out .= '<span class="wff-label visible">' . $item['label'] . '</span>';
        if (substr($item['icon'], 0, 9) == 'dashicons') {
          $out .= '<span class="dashicons ' . $item['icon'] . '"></span>';
        } elseif (!empty($item['icon'])) {
          $out .= '<span class="wff-icon"><img src="' . $icons_url . $item['icon'] . '"></span>';
        }
        $out .= '</a>';
      } // foreach
      $out .= '</div>'; // #wff-menu

      $out .= '</div>'; // #wf-flyout

      echo $out;
    } // admin_footer

You can find above code in filename of '/wf-flyout/wf-flyout.php'. 

 

In "admin_footer()" function after setting up $out variable, the function returns $out variables as it is. If attacker upload malicious XSS script, it can be triggered.

 

PoC

<a href="https://youtube.com/'-alert('Hello world')-'/">This is XSS test</a>

 

 

 

You can see that the plugin patched "admin_footer()" code to escape URLs like this. 

Now, Filtering function specify the allowed css & tag.

저작자표시 비영리 변경금지 (새창열림)
'💻 Security' 카테고리의 다른 글
  • CVE-2023-27224 (NginxProxyManager)
  • CVE-2024-4367 (PDF.js - Arbitrary JS Execution)
  • Directory Traversal via ".tar" file
  • Apache OFBIZ Vulnerability (CVE-2023-49070)
Cronus
Cronus
Offensive Security Researcher
  • Cronus
    Cronus
    Striving to be the best.
    • 분류 전체보기 (251)
      • AboutMe (1)
      • Portfolio (1)
        • Things (1)
      • Bug Report (1)
      • 🚩 CTF (23)
        • Former Doc (9)
        • 2023 (9)
      • 💻 Security (5)
      • 🖌️ Theory (22)
        • WEB (9)
        • PWN (13)
      • 📄 Project (6)
        • Edu_Siri (6)
      • Dreamhack (156)
        • WEB (95)
        • PWN (41)
        • Crypto (14)
        • ETC (6)
      • Wargame (22)
        • HackCTF (22)
      • Bug Bounty (1)
        • Hacking Zone (1)
      • Tips (7)
      • Development (2)
        • Machine Learning & Deep Lea.. (1)
      • Offensive Tools (1)
  • 블로그 메뉴

    • 홈
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    python
    cache
    bug hunter
    bug report
    TFCCTF2022
    Crypto
    Remote Code Execution
    sqli
    cache poisoning
    Ubuntu 기초
    ubuntu 명령어
    pwntools
    GPNCTF
    Ubuntu 기초 셋팅
    Machine Learning
    Text Summarization
    Deep learning
    TsukuCTF2022
    justCTF
    RCE
  • 최근 댓글

  • 최근 글

Cronus
[ CVE-2022-1582 ] Wordpress External Links in New Window Analysis
상단으로

티스토리툴바