WordPress Plugin “Code Snippets” Vulnerability Risked Over 200K Websites

  • 1

Researchers have found another WordPress plugin to be posing a threat to hundreds of thousands of websites. Specifically, they a serious vulnerability in the Code Snippets plugin.

Code Snippets Vulnerability

Reportedly, the team Wordfence has recently discovered a high-severity vulnerability in the WordPress plugin Code Snippets. As revealed through their advisory, there is a CSRF to remote code execution flaw in the plugin. Exploiting the bug could allow an adversary to take control of the target websites.

This is a high severity security issue that could cause complete site takeover, information disclosure, and more.

In brief, the Code Snippets plugin’s import function lacked CSRF protection. This allowed an attacker to craft malicious requests and inject code on the target site.

Although, any codes being imported through the plugin are “disabled” by default. This could ideally have prevented any code execution upon a CSRF attack. However, the researchers found that an adversary could bypass this setting.

An attacker could simply inject an “active” flag with a value of “1” into the JSON body containing the code import details, and the code snippet would be enabled upon import.

The following video demonstrates an attack scenario.

The Developer Patched The Flaws

According to the researchers, the vulnerabilities needed immediate attention owing to their severity and the potential risk to over 200,000 sites, as evident by the number of active installations given on the Plugin web page.

Wordfence found the vulnerabilities on January 23, 2020, after which, they quickly reached the developers. The next day, the developers confirmed the bugs and began working on a fix.

Consequently, on the next day, the developers patched all the flaws with the release of Code Snippets plugin version 2.14.0.

Now, the users must ensure immediately updating their websites with the latest version to avoid any attacks.

Let us know your thoughts in the comments.


Abeerah Hashim

Abeerah has been a passionate blogger for several years with a particular interest towards science and technology. She is crazy to know everything about the latest tech developments. Knowing and writing about cybersecurity, hacking, and spying has always enchanted her. When she is not writing, what else can be a better pastime than web surfing and staying updated about the tech world! Reach out to me at: [email protected]

Do NOT follow this link or you will be banned from the site!

Privacy Preference Center


The __cfduid cookie is used to identify individual clients behind a shared IP address and apply security settings on a per-client basis.

cookie_notice_accepted and gdpr[allowed_cookies] are used to identify the choices made from the user regarding cookie consent.

For example, if a visitor is in a coffee shop where there may be several infected machines, but the specific visitor's machine is trusted (for example, because they completed a challenge within your Challenge Passage period), the cookie allows Cloudflare to identify that client and not challenge them again. It does not correspond to any user ID in your web application, and does not store any personally identifiable information.

__cfduid, cookie_notice_accepted, gdpr[allowed_cookies]


DoubleClick by Google refers to the DoubleClick Digital Marketing platform which is a separate division within Google. This is Google’s most advanced advertising tools set, which includes five interconnected platform components.

DoubleClick Campaign Manager: the ad-serving platform, called an Ad Server, that delivers ads to your customers and measures all online advertising, even across screens and channels.

DoubleClick Bid Manager – the programmatic bidding platform for bidding on high-quality ad inventory from more than 47 ad marketplaces including Google Display Network.

DoubleClick Ad Exchange: the world’s largest ad marketplace for purchasing display, video, mobile, Search and even Facebook inventory.

DoubleClick Search: is more powerful than AdWords and used for purchasing search ads across Google, Yahoo, and Bing.

DoubleClick Creative Solutions: for designing, delivering and measuring rich media (video) ads, interactive and expandable ads.



The _ga is asssociated with Google Universal Analytics - which is a significant update to Google's more commonly used analytics service. This cookie is used to distinguish unique users by assigning a randomly generated number as a client identifier. It is included in each page request in a site and used to calculate visitor, session and campaign data for the sites analytics reports. By default it is set to expire after 2 years, although this is customisable by website owners.

The _gat global object is used to create and retrieve tracker objects, from which all other methods are invoked. Therefore the methods in this list should be run only off a tracker object created using the _gat global variable. All other methods should be called using the _gaq global object for asynchronous tracking.

_gid works as a user navigates between web pages, they can use the gtag.js tagging library to record information about the page the user has seen (for example, the page's URL) in Google Analytics. The gtag.js tagging library uses HTTP Cookies to "remember" the user's previous interactions with the web pages.

_ga, _gat, _gid