WP Manifestindependent plugin directory
manifest / performance / aliyun-cdn-helper

Aliyun CDN Helper WP Registry grade D+. High-severity findings · 2 findingsWP RegistryHigh-severity findings · 2 findingsOpen the reportD+

适用于 WordPress 的阿里云 CDN 辅助插件

★ 17stars
v2.5latest · 6 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/0xjacky/aliyun-cdn-helper/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

阿里云 CDN 辅助插件 (Aliyun CDN Helper For WordPress)

本插件为 WordPress 的管理页面的工具栏添加快捷按钮,方便站长在修改完静态资源后能快速刷新 CDN 缓存。

当前版本

v2.5

image

插件特色

  1. 一键刷新缓存
  2. 配置简单
  3. 设置页面可以显示当日的刷新剩余量
  4. 中英文支持
  5. 支持文件刷新和目录刷新

建议环境

PHP 7.3+

WordPress 5.3+

插件的使用

下载

Latest Release

安装

将压缩包解压,上传到 /wp-content/plugins/ 或通过 WordPress 插件管理页面上传插件压缩包来安装

配置

  1. 启动插件
  2. 进入 设置->阿里云 CDN 完成设置后即可使用

配置的相关说明

刷新文件类型:

这个是对快捷按钮的设置,如果选择 刷新当前主题目录内的静态文件(目录) 或 全站刷新(目录) 则请求强制回源拉取更新的目录(使用一个刷新目录配额)。

v2.5 版本更新:

  1. 代码重构

  2. API Restful

  3. 更新 SDK

v2.2 版本更新:

  1. 修复了一些小问题

  2. 阿里云 SDK 已支持批量刷新,但貌似会提示文件名称格式不正确的问题,所以仍使用循环提交的方式,并做了一些小调整,只提交后缀为 css, js 的文件

  3. 为了提交到 WordPress 已将插件名更名为 Aliyun CDN Helper。(求 dalao 给它取个更好听的名字w)

刷新自定义 URL

功能如题所示,对应阿里云 CDN 控制台的 URL 刷新,如果强行要输入目录的话不要忘记末尾的 /。

容错机制暂未完善,一旦出现异常将立即返回错误,如果刷新错误请检查每一行的 URL 书写是否规范。

支持

如果您喜欢这个插件,欢迎捐助我~

image

Releases

3 releases.

Tag
Published
v2.5 latest
Dec 10, 2019 6 years ago
2.1
Aug 29, 2017 9 years ago
2.0
Aug 28, 2017 9 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

D+ grade

Security

Aliyun CDN Helper 2.1 · audited by WP Registry

High-severity findings.

1 high 1 medium
Audited release
2.1
Findings
2
Worst severity
high
Content hash
5d25ea962c46e9f88c5f9ec6…

Findings

  • high CSRF to stored XSS in Aliyun CDN settings (unsanitized custom URLs and Access Key ID)

    xss_stored

    Settings::handle_submit() trims $_POST['custom_urls'] and $_POST['access_key_id'] into option alicdn_options with no sanitize_* and no escaping on output. view/settings.php prints Config::$custom_urls inside a <textarea> and Config::$accessKeyId inside an input value attribute with no esc_textarea/esc_attr (the plugin contains zero esc_* / sanitize_* calls). settings_page() always includes that view after a POST, so a CSRF body such as custom_urls=</textarea><script>…</script> is stored and executed in the same administrator response. The injected script runs with the victim's wp-admin privileges (plugin install, user-new, wp_rest nonce already on the page). On multisite, where site administrators lack unfiltered_html, this is also a stored-XSS primitive against other admins who open Settings → Alibaba Cloud CDN. Subscriber-or-equivalent cannot POST this themselves (menu cap administrator); the unauthenticated path is the missing nonce on the same handler.

    view/settings.php:31-58

    Recommendation

    Escape with esc_attr() on the Access Key ID value and esc_textarea() on custom_urls. On save, sanitize_text_field / sanitize_textarea_field (and keep secrets out of HTML). Pair with a verified nonce as in the CSRF finding so an unauthenticated page cannot plant the payload.

  • medium Settings save has no nonce or capability check and overwrites Aliyun CDN credentials

    csrf

    add_options_page registers Settings::settings_page with capability 'administrator'. Any POST to that screen calls handle_submit(), which writes access_key_id, access_key_secret, refresh_type, and custom_urls into option alicdn_options. The form uses wp_nonce_url(Config::$settings_url) (default action -1) but handle_submit never calls wp_verify_nonce or check_admin_referer, and it has no current_user_can of its own. A cross-site POST from a page visited by a logged-in Administrator therefore replaces the site's Aliyun AccessKey pair and refresh policy. Empty access_key_secret is ignored, so an attacker can keep the existing secret while changing refresh_type or custom_urls. Consumers: Api::build_request uses the stored keys against cdn.aliyuncs.com; do_refresh uses refresh_type to choose ObjectPath (including whole-site Directory purge). REST refresh itself is not CSRF-able (permission_callback level_10 plus WP REST nonce header). Not Subscriber-reachable; blast is operator CSRF of CDN credentials and purge behavior.

    src/Settings.php:33-56

    Recommendation

    Call check_admin_referer() (and wp_nonce_field in the form, not only wp_nonce_url on the action) before writing options. Also require current_user_can('manage_options') inside handle_submit rather than relying solely on the menu capability string 'administrator'.

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.