{"id":34692,"date":"2020-12-09T06:50:47","date_gmt":"2020-12-09T12:50:47","guid":{"rendered":"https:\/\/wpengine.com\/?post_type=resource&#038;p=34692"},"modified":"2025-05-27T21:05:47","modified_gmt":"2025-05-28T02:05:47","slug":"javascript-security","status":"publish","type":"resource","link":"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/","title":{"rendered":"Solve These Common WordPress JavaScript Security Issues"},"content":{"rendered":"\n<p><span style=\"font-weight: 400\">JavaScript, the browser-side scripting language, is popular for good reason. It can be an excellent foundation for a web application, where lightning-fast response time meets interactive elements to engage users in new ways.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">However, some users are hesitant to jump into the world of JavaScript. In the past, JavaScript was easily exploited to manipulate users on websites. Below we\u2019ll cover some common JavaScript explo<\/span><span style=\"font-weight: 400\">it examples, th<\/span><span style=\"font-weight: 400\">e risks they pose, and how to keep your website secure.<\/span><\/p>\n\n\n\n\n\n\n<h2 class=\"wp-block-heading\">WordPress JavaScript Security Issues<\/h2>\n\n\n\n<p><span style=\"font-weight: 400\">Some of the most com<\/span><span style=\"font-weight: 400\">mon JavaScript exploits a<\/span><span style=\"font-weight: 400\">re Cross-Site Scripting (XSS) and Cross-Site Request Forgery (CSRF), although sometimes you may also see Server-Side JavaScript Injection and issues with Client-Side Logic. We will explore these various attacks below.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">XSS Attacks<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">Cross-Site Scripting, or XSS, is one of the most common browser-side vulnerabilities. These types of attacks happen when an attacker injects malicious code into a legitimate (but vulnerable) application. Attackers can manipulate JavaScript and HTML to trigger the malicious code or scripts. In this way, the vulnerable application or website is used as the \u201cvehicle\u201d to execute the script on the end user.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">CSRF Attacks<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">Cross-Site Request Forgery involves taking over or impersonating a user\u2019s browser session by hijacking the session cookie. CSRF attacks can trick users into executing malicious actions the attacker wants, or into taking unauthorized actions on the website. In this example, the session cookie is the \u201cvehicle\u201d an attacker uses to impersonate a legitimate user.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Server-Side JavaScript Injection<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">Server-Side JavaScript Injection is a newer type of JavaScript exploit, primarily targeted at Node.js apps and NoSQL. While XSS attacks are executed in the end user\u2019s web browser, Server-Side attacks are executed on the server level, which can have more disastrous effects on a website.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">In this type of injection, an attacker could upload and execute malicious binary files on the web server. Vulnerable code is again the \u201cvehicle\u201d used by the attacker in this example.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Client-Side Logic Issues<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">When developers choose to perform secure processing client-side, this can open up the browser to attackers who might be listening in. For example, if your website code hardcodes API keys into client-side JavaScript, this would be vulnerable to attackers. In this example, poor website coding practices are the \u201cvehicle\u201d attackers use to exploit your website and its users.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Security Issues &amp; Risks<\/h2>\n\n\n\n<p><span style=\"font-weight: 400\">When JavaScript vulnerabilities like those discussed above exist, your site is vulnerable to attackers. A hacked website can mean brand damage, downtime while your website is being cleaned, and distrust from your users. That means your business is losing dollars and cents, productivity, and the trust of what may have been very loyal customers.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">There are sometimes legal connotations to security vulnerabilities as well, especially user impersonation in CSRF attacks. All in all, insecure JavaScript and bad coding practices can cost your business money and integrity.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">WordPress &amp; JavaScript Security Risks<\/h2>\n\n\n\n<p><span style=\"font-weight: 400\">There are a few significant risks when using JavaScript in WordPress. Let\u2019s take a look at two of the most common: the <\/span><i><span style=\"font-weight: 400\">eval()<\/span><\/i><span style=\"font-weight: 400\"> function and poorly-coded WordPress plugins.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Eval() in JavaScript Security Risks<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">The <\/span><i><span style=\"font-weight: 400\">eval()<\/span><\/i><span style=\"font-weight: 400\"> function essentially takes a string of code and attempts to run it as JavaScript. This function exists in several programming languages and has a few legitimate uses, but developers should be careful with it. That\u2019s because using <\/span><i><span style=\"font-weight: 400\">eval()<\/span><\/i><span style=\"font-weight: 400\"> in JavaScript can pose a major security risk.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">This risk comes primarily from the function\u2019s use to evaluate user input. If a savvy user comes across a text field on your site that is running <\/span><i><span style=\"font-weight: 400\">eval()<\/span><\/i><span style=\"font-weight: 400\">, they could use it to execute malicious code. This is known as <a href=\"https:\/\/owasp.org\/www-community\/attacks\/xss\/\" target=\"_blank\" rel=\"noreferrer noopener\">Cross-Site Scripting (XSS)<\/a>, and avoiding the use of the <\/span><i><span style=\"font-weight: 400\">eval()<\/span><\/i><span style=\"font-weight: 400\"> is one way to safeguard your WordPress site from that kind of attack.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">WordPress Plugins &amp; JavaScript Security Issues<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">Many WordPress users search for a free plugin when they need a specific piece of functionality for their websites. While most of the time this works out, you need to be careful of (and selective about) what plugins you install on your site. That\u2019s because many of them can cause potential security issues, thanks to their use of JavaScript.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">Of course, not every plugin will cause JavaScript issues. However, many WordPress plugins use JavaScript, which means you\u2019re relying on the knowledge and experience of the developer to keep your site secure. In general, the best way to avoid any potential issues is to look for plugins that have a large number of active installations, high ratings, and a consistent update history.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Security Scanners<\/h2>\n\n\n\n<p><span style=\"font-weight: 400\">There are several security tools which will help examine your website (or web application) from the outside to determine if it is vulnerable to injection and attacks. Before getting started with any of these tools, be sure to check in with your web host to check their Penetration Testing policies. Below we will explore some of the top vulnerability scanning tools. <\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">ZAP<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">ZAP, or <a href=\"http:\/\/code.google.com\/p\/zaproxy\/\" target=\"_blank\" rel=\"noreferrer noopener\">Zed Attack Proxy<\/a>, was developed by security authority OWASP and offers the ability to easily scan your website for a wide range of vulnerabilities. This tool can be used by a wide range of user levels because of its intuitive interface, and is widely customizable to your project\u2019s needs. <\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Grabber<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\"><a href=\"http:\/\/rgaucher.info\/beta\/grabber\/\" target=\"_blank\" rel=\"noreferrer noopener\">Grabber<\/a> can scan your website for vulnerabilities ranging from SQL injection and XSS to AJAX testing and File inclusion. Grabber tends to be a slower scanner than others, so it should only be used on smaller websites or web applications. <\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Wapiti<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\"><a href=\"http:\/\/wapiti.sourceforge.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">Wapiti<\/a> allows users to test attack and injection vectors using both GET and POST HTTP Requests. It detects File Disclosure and File Inclusion, XSS, weak Apache configurations, and more. This is a more advanced tool that is executed via command line. <\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Secure JavaScript Code<\/h2>\n\n\n\n<p><span style=\"font-weight: 400\">Knowing the most common attack vectors and vulnerabilities is an important step to securing your website. However, there are also JavaScript development best practices that should be followed to avoid these issues. While there is never a guarantee your code will be secure always, these steps will prevent many attacks by nature. <\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Avoid using eval()<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">The eval() function is used by developers to run text as code, which is by nature a dangerous practice. In most cases, substitutions can be made to where these functions are not needed. Wherever possible, replace eval() with more secure functions.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Use SSL\/HTTPS<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">SSL, or Secure Sockets Layer, is a way of encrypting the data users send across the web when interacting with your website. It is extremely important for pages where users input data (login pages, contact forms, cart, checkout, account) to be secured with SSL. <\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Use CORS Headers<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">CORS, or Cross-Origin Resource Sharing, is a header you can set that defines the sources allowed to reference your website\u2019s resources. These rules can be placed in your Nginx configuration file, or if you use Apache, in your .htaccess file:<\/span><\/p>\n\n\n\n<p><code>Access-Control-Allow-Origin: http:\/\/foo.example <\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Define a Content Security Policy<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">A Content Security Policy is a header you can set in your Nginx configuration file, or if you use Apache, in your .htaccess file. This policy allows you to define allowed sources for JavaScript code, styles, fonts, frames, media, and more. Your header will generally look like this:<\/span><\/p>\n\n\n\n<p><code>Content-Security-Policy: default-src: 'self'; script-src: https:\/\/apis.google.com;<\/code><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">The above policy says that by default all sources should be the Host\/website itself, and for JavaScript it will also accept apis.google.com. All other sources would be rejected.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Set Secure Cookies in JavaScript<\/h2>\n\n\n\n<p><span style=\"font-weight: 400\">Another way you can ensure user information is encrypted is by restricting the use of your cookies to secure web pages only. This means the cookie will not be sent if the page is not using SSL\/HTTPS. To specify a cookie as \u201cSecure,\u201d or only sent over HTTPS, you can use the following syntax:<\/span><\/p>\n\n\n\n<p><code>document.cookie = \"tagname = test;secure\";<\/code><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">For reference, the following attributes can be used when setting a cookie:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><b>Secure<\/b><span style=\"font-weight: 400\"> &#8211; The Cookie will be sent in secure channel&#8211;HTTPS<\/span><\/li>\n\n\n\n<li><b>HttpOnly<\/b><span style=\"font-weight: 400\">&#8211; Don&#8217;t allow local scripts read cookies.<\/span><\/li>\n\n\n\n<li><b>Domain<\/b><span style=\"font-weight: 400\">&#8211; Double-check the domain settings.<\/span><\/li>\n\n\n\n<li><b>Path<\/b><span style=\"font-weight: 400\"> &#8211; Double-check the path settings.<\/span><\/li>\n\n\n\n<li><b>Expires<\/b><span style=\"font-weight: 400\"> &#8211; Determine the user agent how to parse or how to choose the expiry-time.<\/span><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript API Security<\/h2>\n\n\n\n<p><span style=\"font-weight: 400\">API security can be a struggle, because JSON is run and returned client-side. That means some of the inner workings of your API will be exposed to the web if anyone looks closely enough. There are, however, a few specific options for sending sensitive information with APIs. <\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">When using a JavaScript API system, the security and authentication system you use may vary based on your project needs. In this section we will outline the various API security options, and who should use them.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Securing API Keys in a Client-Side JavaScript Application<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">The most commonly-used option is to set an API Access and Secret Key pair. These keys allow access to the API, and assign an individual secret token to each end user. If the Access and Secret Key pairs don\u2019t match up, the access to the API is revoked or denied. <\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">Companies like Google and Facebook commonly use this method for validation of end users. While Facebook primarily depends on the Secret Key assigned to each user, Google tends to use a Secret Key on the actual server, via OAuth. The key management option is likely the best for organizations with wide, possibly unknown user bases.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Restrict Access to Specific IP Ranges<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">If your API will only be used within a specific group or building, you can manage API security by simply maintaining an IP whitelist of allowed IP addresses. This option can be tedious if the IP addresses tend to change often however, so it is best for limited groups of known users that don\u2019t change often.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Rate Limit IP Addresses<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">Another less cumbersome option for API security would be to rate limit IP addresses, so they can only access the API a limited number of times per day before being blacklisted. Before implementing this type of system, you should gather usage statistics to determine if there is a distinct difference between users who really like your API, and attackers who are trying to exploit or abuse it. <\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">WP Engine and JavaScript Security<\/h2>\n\n\n\n<p><span style=\"font-weight: 400\">WP Engine, is a top <a href=\"https:\/\/wpengine.com\/managed-wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">managed host for WordPress<\/a> that is <a href=\"https:\/\/wpengine.com\/blog\/11-top-wordpress-security-concerns-how-wp-engine-takes-care-of-them-for-you\/\" target=\"_blank\" rel=\"noreferrer noopener\">serious about security<\/a>. Our dedicated security team monitors for vulnerabilities to notify our customers of any concerns.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">Additionally, our <a href=\"https:\/\/wpengine.com\/secure-wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">secure hosting<\/a> platform automatically keeps WordPress up to date with the latest functional and maintenance updates to ensure your website is protected. <\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">Ready to learn more? Check out <a href=\"https:\/\/wpengine.com\/plans\/\" target=\"_blank\" rel=\"noreferrer noopener\">WP Engine&#8217;s hosting plans<\/a>.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript, the browser-side scripting language, is popular for good reason. It can be an excellent foundation for a web application, where lightning-fast response time meets interactive elements to engage users in new ways. However, some users are hesitant to jump into the world of JavaScript. In the past, JavaScript was easily exploited to manipulate users<span class=\"tile__ellipses\">&hellip;<\/span><span class=\"tile__ellipses--animated\"><\/span><\/p>\n","protected":false},"author":1,"featured_media":34694,"template":"","resource-topic":[909],"resource-role":[],"resource-type":[916],"class_list":["post-34692","resource","type-resource","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Identify &amp; Fix JavaScript Security Issues<\/title>\n<meta name=\"description\" content=\"JavaScript is a powerful programming language, but JavaScript code is vulnerable to security risks. Learn to identify risks and ensure JavaScript security.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Identify &amp; Fix JavaScript Security Issues\" \/>\n<meta property=\"og:description\" content=\"JavaScript is a powerful programming language, but JavaScript code is vulnerable to security risks. Learn how to identify risks and ensure JavaScript security.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-28T02:05:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/01\/javascript_security_banner.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Identify &amp; Fix JavaScript Security Issues\" \/>\n<meta name=\"twitter:description\" content=\"JavaScript is a powerful programming language, but JavaScript code is vulnerable to security risks. Learn how to identify risks and ensure JavaScript security.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/01\/javascript_security_banner.png\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/\",\"url\":\"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/\",\"name\":\"Identify & Fix JavaScript Security Issues\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\"},\"datePublished\":\"2020-12-09T12:50:47+00:00\",\"dateModified\":\"2025-05-28T02:05:47+00:00\",\"description\":\"JavaScript is a powerful programming language, but JavaScript code is vulnerable to security risks. Learn to identify risks and ensure JavaScript security.\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/case-studies\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resources\",\"item\":\"https:\/\/wpengine.com\/case-studies\/resources\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Solve These Common WordPress JavaScript Security Issues\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\",\"url\":\"https:\/\/wpengine.com\/case-studies\/\",\"name\":\"WP Engine\",\"description\":\"Managed Hosting for WordPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085\",\"name\":\"WP Engine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"caption\":\"WP Engine\"},\"sameAs\":[\"https:\/\/wpengine.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Identify & Fix JavaScript Security Issues","description":"JavaScript is a powerful programming language, but JavaScript code is vulnerable to security risks. Learn to identify risks and ensure JavaScript security.","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"Identify & Fix JavaScript Security Issues","og_description":"JavaScript is a powerful programming language, but JavaScript code is vulnerable to security risks. Learn how to identify risks and ensure JavaScript security.","og_url":"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/","og_site_name":"WP Engine","article_publisher":"https:\/\/www.facebook.com\/wpengine","article_modified_time":"2025-05-28T02:05:47+00:00","og_image":[{"width":1100,"height":400,"url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/01\/javascript_security_banner.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_title":"Identify & Fix JavaScript Security Issues","twitter_description":"JavaScript is a powerful programming language, but JavaScript code is vulnerable to security risks. Learn how to identify risks and ensure JavaScript security.","twitter_image":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/01\/javascript_security_banner.png","twitter_site":"@wpengine","twitter_misc":{"Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/","url":"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/","name":"Identify & Fix JavaScript Security Issues","isPartOf":{"@id":"https:\/\/wpengine.com\/case-studies\/#website"},"datePublished":"2020-12-09T12:50:47+00:00","dateModified":"2025-05-28T02:05:47+00:00","description":"JavaScript is a powerful programming language, but JavaScript code is vulnerable to security risks. Learn to identify risks and ensure JavaScript security.","breadcrumb":{"@id":"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/case-studies\/resources\/javascript-security\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/case-studies\/"},{"@type":"ListItem","position":2,"name":"Resources","item":"https:\/\/wpengine.com\/case-studies\/resources\/"},{"@type":"ListItem","position":3,"name":"Solve These Common WordPress JavaScript Security Issues"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/case-studies\/#website","url":"https:\/\/wpengine.com\/case-studies\/","name":"WP Engine","description":"Managed Hosting for WordPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085","name":"WP Engine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","caption":"WP Engine"},"sameAs":["https:\/\/wpengine.com"]}]}},"acf":[],"grid_image_url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/01\/javascript_security_grid.png","media-type":{"term_id":916,"name":"Article","slug":"article"},"role":false,"topic":"<strong>Topics:<\/strong> Security","_links":{"self":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource\/34692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource"}],"about":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/types\/resource"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/users\/1"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media\/34694"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media?parent=34692"}],"wp:term":[{"taxonomy":"resource-topic","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-topic?post=34692"},{"taxonomy":"resource-role","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-role?post=34692"},{"taxonomy":"resource-type","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-type?post=34692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}