Pelajari lebih lanjut tentang keamanan perangkat lunak core WordPress dalam artikel gratis berikut. Anda juga dapat mengunduhnya dalamformat PDF.
Ikhtisar
This document is an analysis and explanation of the WordPress core software development and its related security processes, as well as an examination of the inherent security built directly into the software. Decision makers evaluating WordPress as a content management system or web application framework should use this document in their analysis and decision-making, and for developers to refer to it to familiarize themselves with the security components and best practices of the software.
The information in this document is up-to-date for the latest stable release of the software, WordPress 4.7 at time of publication, but should be considered relevant also to the most recent versions of the software as backwards compatibility is a strong focus for the WordPress development team. Specific security measures and changes will be noted as they have been added to the core software in specific releases. It is strongly encouraged to always be running the latest stable version of WordPress to ensure the most secure experience possible.
Ringkasan Eksekutif
WordPress is a dynamic open-source content management system which is used to power millions of websites, web applications, and blogs. It currently powers more than 35% of the top 10 million websites on the Internet. WordPress’ usability, extensibility, and mature development community make it a popular and secure choice for websites of all sizes.
Since its inception in 2003, WordPress has undergone continual hardening so its core software can address and mitigate common security threats, including the Top 10 list identified by The Open Web Application Security Project (OWASP) as common security vulnerabilities, which are discussed in this document.
The WordPress Security Team, in collaboration with the WordPress Core Leadership Team and backed by the WordPress global community, works to identify and resolve security issues in the core software available for distribution and installation at WordPress.org, as well as recommending and documenting security best practices for third-party plugin and theme authors.
Site developers and administrators should pay particular attention to the correct use of core APIs and underlying server configuration which have been the source of common vulnerabilities, as well as ensuring all users employ strong passwords to access WordPress.
Gambaran Umum WordPress
WordPress is a free and open source content management system (CMS). It is the most widely-used CMS software in the world and it powers more than 35% of the top 10 million websites1, giving it an estimated 62% market share of all sites using a CMS.
WordPress is licensed under the General Public License (GPLv2 or later) which provides four core freedoms, and can be considered as the WordPress “bill of rights”:
- Kebebasan untuk menjalankan program, untuk tujuan apa pun.
- Kebebasan untuk mempelajari cara sebuah program bekerja, dan mengubahnya sesuai kebutuhan Anda.
- Kebebasan untuk mendistribusi ulang.
- Kebebasan untuk mendistribusikan salinan Anda versi modifikasi kepada orang lain.
Tim Kepemimpinan Core WordPress
The WordPress project is a meritocracy, run by a core leadership team, and led by its co-creator and lead developer, Matt Mullenweg. The team governs all aspects of the project, including core development, WordPress.org, and community initiatives.
The Core Leadership Team consists of Matt Mullenweg, five lead developers, and more than a dozen core developers with permanent commit access. These developers have final authority on technical decisions, and lead architecture discussions and implementation efforts.
WordPress has a number of contributing developers. Some of these are former or current committers, and some are likely future committers. These contributing developers are trusted and veteran contributors to WordPress who have earned a great deal of respect among their peers. As needed, WordPress also has guest committers, individuals who are granted commit access, sometimes for a specific component, on a temporary or trial basis.
The core and contributing developers primarily guide WordPress development. Every version, hundreds of developers contribute code to WordPress. These core contributors are volunteers who contribute to the core codebase in some way.
Siklus Penerbitan WordPress
Each WordPress release cycle is led by one or more of the core WordPress developers. A release cycle usually lasts around 4 months from the initial scoping meeting to launch of the version.
Siklus penerbitan memiliki alur berikut2:
- Phase 1: Planning and securing team leads. This is done in the #core chat room on Slack. The release lead discusses features for the next release of WordPress. WordPress contributors get involved with that discussion. The release lead will identify team leads for each of the features.
- Phase 2: Development work begins. Team leads assemble teams and work on their assigned features. Regular chats are scheduled to ensure the development keeps moving forward.
- Phase 3: Beta. Betas are released, and beta-testers are asked to start reporting bugs. No more commits for new enhancements or feature requests are carried out from this phase on. Third-party plugin and theme authors are encouraged to test their code against the upcoming changes.
- Phase 4: Release Candidate. There is a string freeze for translatable strings from this point on. Work is targeted on regressions and blockers only.
- Tahap 5: Peluncuran. Versi WordPress diluncurkan dan tersedia di Admin WordPress untuk pembaruan.
Penomoran Versi dan Siaran Keamanan
A major WordPress version is dictated by the first two sequences. For example, 3.5 is a major release, as is 3.6, 3.7, or 4.0. There isn’t a “WordPress 3” or “WordPress 4” and each major release is referred to by its numbering, e.g., “WordPress 3.9.”
Major releases may add new user features and developer APIs. Though typically in the software world, a “major” version means you can break backwards compatibility, WordPress strives to never break backwards compatibility. Backwards compatibility is one of the project’s most important philosophies, with the aim of making updates much easier on users and developers alike.
A minor WordPress version is dictated by the third sequence. Version 3.5.1 is a minor release, as is 3.4.23. A minor release is reserved for fixing security vulnerabilities and addressing critical bugs only. Since new versions of WordPress are released so frequently — the aim is every 4-5 months for a major release, and minor releases happen as needed — there is only a need for major and minor releases.
Kompatibilitas Versi Sebelumnya
The WordPress project has a strong commitment to backwards compatibility. This commitment means that themes, plugins, and custom code continues to function when WordPress core software is updated, encouraging site owners to keep their WordPress version updated to the latest secure release.
WordPress dan Keamanan
Tim Keamanan WordPress
The WordPress Security Team is made up of approximately 50 experts including lead developers and security researchers — about half are employees of Automattic (makers of WordPress.com, the earliest and largest WordPress hosting platform on the web), and a number work in the web security field. The team consults with well-known and trusted security researchers and hosting companies3.
The WordPress Security Team often collaborates with other security teams to address issues in common dependencies, such as resolving the vulnerability in the PHP XML parser, used by the XML-RPC API that ships with WordPress, in WordPress 3.9.24. This vulnerability resolution was a result of a joint effort by both WordPress and Drupal security teams.
Risiko, Proses, dan Riwayat Keamanan WordPress
The WordPress Security Team believes in Responsible Disclosure by alerting the security team immediately of any potential vulnerabilities. Potential security vulnerabilities can be signaled to the Security Team via the WordPress HackerOne5. The Security Team communicates amongst itself via a private Slack channel, and works on a walled-off, private Trac for tracking, testing, and fixing bugs and security problems.
Each security report is acknowledged upon receipt, and the team works to verify the vulnerability and determine its severity. If confirmed, the security team then plans for a patch to fix the problem which can be committed to an upcoming release of the WordPress software or it can be pushed as an immediate security release, depending on the severity of the issue.
For an immediate security release, an advisory is published by the Security Team to the WordPress.org News site6 announcing the release and detailing the changes. Credit for the responsible disclosure of a vulnerability is given in the advisory to encourage and reinforce continued responsible reporting in the future.
Administrators of the WordPress software see a notification on their site dashboard to upgrade when a new release is available, and following the manual upgrade users are redirected to the About WordPress screen which details the changes. If administrators have automatic background updates enabled, they will receive an email after an upgrade has been completed.
Pembaruan Tertutup Otomatis untuk Penerbitan Keamanan
Starting with version 3.7, WordPress introduced automated background updates for all minor releases7, such as 3.7.1 and 3.7.2. The WordPress Security Team can identify, fix, and push out automated security enhancements for WordPress without the site owner needing to do anything on their end, and the security update will install automatically.
When a security update is pushed for the current stable release of WordPress, the core team will also push security updates for all the releases that are capable of background updates (since WordPress 3.7), so these older but still recent versions of WordPress will receive security enhancements.
Individual site owners can opt to remove automatic background updates through a simple change in their configuration file, but keeping the functionality is strongly recommended by the core team, as well as running the latest stable release of WordPress.
Top 10 OWASP 2013
The Open Web Application Security Project (OWASP) is an online community dedicated to web application security. The OWASP Top 10 list8 focuses on identifying the most serious application security risks for a broad array of organizations. The Top 10 items are selected and prioritized in combination with consensus estimates of exploitability, detectability, and impact estimates.
The following sections discuss the APIs, resources, and policies that WordPress uses to strengthen the core software and 3rd party plugins and themes against these potential risks.
A1 - Injeksi
There is a set of functions and APIs available in WordPress to assist developers in making sure unauthorized code cannot be injected, and help them validate and sanitize data. Best practices and documentation are available9 on how to use these APIs to protect, validate, or sanitize input and output data in HTML, URLs, HTTP headers, and when interacting with the database and filesystem. Administrators can also further restrict the types of file which can be uploaded via filters.
A2 - Broken Authentication and Session Management
WordPress core software manages user accounts and authentication and details such as the user ID, name, and password are managed on the server-side, as well as the authentication cookies. Passwords are protected in the database using standard salting and stretching techniques. Existing sessions are destroyed upon logout for versions of WordPress after 4.0.
A3 - Cross Site Scripting (XSS)
WordPress provides a range of functions which can help ensure that user-supplied data is safe10. Trusted users, that is administrators and editors on a single WordPress installation, and network administrators only in WordPress Multisite, can post unfiltered HTML or JavaScript as they need to, such as inside a post or page. Untrusted users and user-submitted content is filtered by default to remove dangerous entities, using the KSES library through the wp_kses
function.
As an example, the WordPress core team noticed before the release of WordPress 2.3 that the function the_search_query()
was being misused by most theme authors, who were not escaping the function’s output for use in HTML. In a very rare case of slightly breaking backward compatibility, the function’s output was changed in WordPress 2.3 to be pre-escaped.
A4 - Insecure Direct Object Reference
WordPress often provides direct object reference, such as unique numeric identifiers of user accounts or content available in the URL or form fields. While these identifiers disclose direct system information, WordPress’ rich permissions and access control system prevent unauthorized requests.
A5 - Kesalahan Konfigurasi Keamanan
The majority of the WordPress security configuration operations are limited to a single authorized administrator. Default settings for WordPress are continually evaluated at the core team level, and the WordPress core team provides documentation and best practices to tighten security for server configuration for running a WordPress site11.
A6 - Paparan Data yang Sensitif
Kata sandi akun pengguna WordPress di garami dan di hash berdasarkan Portable PHP Password Hashing Framework12. Sistem hak akses WordPress digunakan untuk mengendalikan akses pada informasi pribadi seperti PII pengguna terdaftar, alamat surel pemberi komentar, konten privat terpublikasi, dsb. Dalam WordPress 3.7, kekuatan kata sandi dimasukkan pada inti perangkat lunak memberikan tambahan informasi bagaimana pengguna mengatur kata sandi-nya dan memberi petunjuk untuk meningkatkan kekuatan. WordPress juga memiliki konfigurasi pengaturan opsional untuk mewajibkan HTTPS.
A7 - Kontrol Akses Level Fungsi yang Hilang
WordPress checks for proper authorization and permissions for any function level access requests prior to the action being executed. Access or visualization of administrative URLs, menus, and pages without proper authentication is tightly integrated with the authentication system to prevent access from unauthorized users.
A8 - Pemalsuan Permintaan Lintas Situs (CSRF)
WordPress menggunakan token kriptografik yang disebut nonces13, untuk memvalidasi intensi permintaan aksi dari pengguna terotorisasi untuk melindungi dari ancaman CSRF potensial. WordPress menyediakan API untuk menghasilkan token ini untuk menciptakan dan memverifikasi token untik dan temporer, dan token ini terbatas untuk pengguna spesifik, aksi spesifik, objek spesifik, dan waktu spesifik, yang dapat ditambahkan pada formulir dan URL sesuai kebutuhan. Sebagai tambahan, semua nonces akan di-invalidasi saat keluar.
A9 - Penggunaan Komponen dengan Kerentanan yang Dipahami
The WordPress core team closely monitors the few included libraries and frameworks WordPress integrates with for core functionality. In the past the core team has made contributions to several third-party components to make them more secure, such as the update to fix a cross-site vulnerability in TinyMCE in WordPress 3.5.214.
If necessary, the core team may decide to fork or replace critical external components, such as when the SWFUpload library was officially replaced by the Plupload library in 3.5.2, and a secure fork of SWFUpload was made available by the security team<15 for those plugins who continued to use SWFUpload in the short-term.
A10 - Pengalihan dan Penerusan yang Tidak Divalidasi
Sistem autentikasi dan kontrol akses internal WordPress akan melindungi dari upaya untuk mengarahkan pengguna ke tujuan yang tidak diinginkan atau pengarahan otomatis. Fungsi ini juga tersedia bagi developer plugin melalui API wp_safe_redirect()
16.
Risiko dan Kepentingan Keamanan Lebih Lanjut
Serangan pemrosesan XXE (XML eXternal Entity)
When processing XML, WordPress disables the loading of custom XML entities to prevent both External Entity and Entity Expansion attacks. Beyond PHP’s core functionality, WordPress does not provide additional secure XML processing API for plugin authors.
Serangan SSRF (Server Side Request Forgery)
HTTP requests issued by WordPress are filtered to prevent access to loopback and private IP addresses. Additionally, access is only allowed to certain standard HTTP ports.
Keamanan Plugin dan Tema WordPress
Tema Asal
WordPress requires a theme to be enabled to render content visible on the frontend. The default theme which ships with core WordPress (currently "Twenty Twenty") has been vigorously reviewed and tested for security reasons by both the team of theme developers plus the core development team.
The default theme can serve as a starting point for custom theme development, and site developers can create a child theme which includes some customization but falls back on the default theme for most functionality and security. The default theme can be easily removed by an administrator if not needed.
Repositori Tema dan Plugin WordPress.org
There are approximately 50.000+ plugins and 5.000+ themes listed on the WordPress.org site. These themes and plugins are submitted for inclusion and are manually reviewed by volunteers before making them available on the repository.
Inclusion of plugins and themes in the repository is not a guarantee that they are free from security vulnerabilities. Guidelines are provided for plugin authors to consult prior to submission for inclusion in the repository17, and extensive documentation about how to do WordPress theme development18 is provided on the WordPress.org site.
Each plugin and theme has the ability to be continually developed by the plugin or theme owner, and any subsequent fixes or feature development can be uploaded to the repository and made available to users with that plugin or theme installed with a description of that change. Site administrators are notified of plugins which need to be updated via their administration dashboard.
When a plugin vulnerability is discovered by the WordPress Security Team, they contact the plugin author and work together to fix and release a secure version of the plugin. If there is a lack of response from the plugin author or if the vulnerability is severe, the plugin/theme is pulled from the public directory, and in some cases, fixed and updated directly by the Security Team.
Tim Peninjau Tema
The Theme Review Team is a group of volunteers, led by key and established members of the WordPress community, who review and approve themes submitted to be included in the official WordPress Theme directory. The Theme Review Team maintains the official Theme Review Guidelines19, the Theme Unit Test Datas20, and the Theme Check Plugins21, and attempts to engage and educate the WordPress Theme developer community regarding development best practices. Inclusion in the group is moderated by core committers of the WordPress development team.
Peran Penyedia Hosting dalam Keamanan WordPress
WordPress can be installed on a multitude of platforms. Though WordPress core software provides many provisions for operating a secure web application, which were covered in this document, the configuration of the operating system and the underlying web server hosting the software is equally important to keep the WordPress applications secure.
Catatan tentang WordPress.com dan keamanan WordPress
WordPress.com adalah pemasang WordPress terbanyak didunia, dan dimiliki dan dikelola oleh Automattic, Inc., yang didirikan oleh Matt Mullenweg, salah satu pembuat proyek WordPress. WordPress.com berjalan pada inti perangkat lunak WordPress, dan memiliki pemrosesan keamanan sendiri, resiko, dan solusi22. Dokumen ini mengacu pada keamanan terkait hosting-sendiri, perangkat lunak WordPress sumber terbuka yang dapat diunduh dari WordPress.org dan dapat dipasang di server manapun di dunia.
Lampiran
Inti WordPress APIs
The WordPress Core Application Programming Interface (API) is comprised of several individual APIs23, each one covering the functions involved in, and use of, a given set of functionality. Together, these form the project interface which allows plugins and themes to interact with, alter, and extend WordPress core functionality safely and securely.
Sementara setiap API WordPress menyediakan praktik terbaik dan cara standar untuk berinteraksi dengan dan memperluas inti perangkat lunak WordPress, API WordPress berikut ini adalah yang paling relevan untuk membangun dan memperketat keamanan WordPress:
Basis Data API
API24 basis data, ditambahkan pada WordPress 0.71, menyediakan metode yang tepat untuk mengakses data sebagai isian yang diberi nama yang disimpan di lapisan basis data.
Filesystem API
API25 sistem file, ditambahkan pada WordPress 2.626, yang mulanya dibuat untuk WordPress’ memiliki fitur pembaruan otomatis. API sistem file mengabstraksi fungsionalitas yang diperlukan untuk membaca dan menulis file-file lokal ke sistem file secara aman, pada semua hosting.
Hal ini dijalankan melalui class WP_Filesystem_Base
, dan beberapa subclasses yang menerapkan cara-cara berbeda dalam menghubungkan sistem file local, tergantung pada fitur hosting masing-masing. Semua tema dan plugin yang menuliskan file secara lokal menjalankan hal serupa menggunakan kelompok WP_Filesystem classes.
HTTP API
API27 HTTP, ditambahkan di WordPress 2.728 dan dikembangkan di WordPress 2.8, menstandarisasikan permintaan HTTP untuk WordPress. API menangani kuki, pengodean dan mendekodekan gzip, pendekodean bongkah (jika HTTP 1.1), dan implementasi protokol HTTP lain. API menstandarisasikan permintaan, menguji setiap metode sebelum pengiriman, dan, berdasarkan konfigurasi server Anda, menggunakan metode yang sesuai untuk menjalan perintah.
Perizinan dan API pengguna saat ini
Izin dan API29 pengguna aktif merupakan sekumpulan fungsi yang berguna untuk verifikasi izin dan otoritas pengguna yang sedang aktif untuk menjalankan perintah atau operasi yang diminta, dan melindungi dari pengguna yang tidak dikenal mengakses dan menjalankan fungsi diluar kapabilitas yang diizinkan mereka.
Lisensi konten artikel
Teks di dalam dokumen ini (tidak termasuk logo WordPress atau merk dagang) berlisensi CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. Anda dapat menggandakan, mengubah, mendistribusikan dan menggunakan, bahkan untuk keperluan komersil, tanpa harus meminta izin.
Terima kasih khusus kepada security white paper Drupal, yang telah menginspirasi.
Bacaan Lebih Lanjut
- Berita WordPress https://wordpress.org/news/
- Rilis Keamanan WordPress https://wordpress.org/news/category/security/
- Sumber Daya Developer WordPress https://developer.wordpress.org/
Ditulis oleh Sara Rosso
Kontribusi dari Barry Abrahamson, Michael Adams, Jon Cave, Helen Hou-Sandí, Dion Hulse, Mo Jangda, Paul Maiorana
Versi 1.0 March 2015
Catatan kaki
- [1] https://w3techs.com/, as of December 2019
- [2] https://make.wordpress.org/core/handbook/about/release-cycle/
- [3] Andrew Nacin, WordPress lead developer, https://vip.wordpress.com/security
- [4] https://wordpress.org/news/2014/08/wordpress-3-9-2/
- [5] https://hackerone.com/wordpress
- [6] https://wordpress.org/news/
- [7] https://wordpress.org/news/2013/10/basie/
- [8] https://www.owasp.org/index.php/Top_10_2013-Top_10
- [9] https://developer.wordpress.org/plugins/security/
- [10] https://codex.wordpress.org/Data_Validation#HTML.2FXML
- [11] hhttps://wordpress.org/support/article/hardening-wordpress/
- [12] http://www.openwall.com/phpass/
- [13] https://developer.wordpress.org/plugins/security/nonces/
- [14] https://wordpress.org/news/2013/06/wordpress-3-5-2/
- [15] https://make.wordpress.org/core/2013/06/21/secure-swfupload/
- [16] https://developer.wordpress.org/reference/functions/wp_safe_redirect/
- [17] https://wordpress.org/plugins/developers/
- [18] https://developer.wordpress.org/themes/getting-started/
- [19] https://make.wordpress.org/themes/handbook/review/
- [20] http://codex.wordpress.org/Theme_Unit_Test
- [21] https://wordpress.org/plugins/theme-check/
- [22] https://automattic.com/security/
- [23] https://codex.wordpress.org/WordPress_APIs
- [24] https://developer.wordpress.org/apis/handbook/database/
- [25] https://codex.wordpress.org/Filesystem_API
- [26] https://wordpress.org/support/wordpress-version/version-2-6/
- [27] https://developer.wordpress.org/plugins/http-api/
- [28] https://wordpress.org/support/wordpress-version/version-2-7/
- [29] https://developer.wordpress.org/reference/functions/current_user_can/