{"id":1182,"date":"2020-11-19T20:54:54","date_gmt":"2020-11-20T01:54:54","guid":{"rendered":"https:\/\/truxgoservers.com\/blog\/?p=1182"},"modified":"2020-11-20T15:25:07","modified_gmt":"2020-11-20T20:25:07","slug":"what-should-we-know-about-security-with-javascript","status":"publish","type":"post","link":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/","title":{"rendered":"What should we know about security with JavaScript"},"content":{"rendered":"\n<p>Javascript is an interpreted programming language, it is not compiled, that is, it is read and interpreted directly by the browser as source code when it reads the page.<\/p>\n\n\n\n<p>In programming it is always very important to take security into account when writing code and one of the main points that we must take into account is Cross Site Scripting (XSS). In PHP escape functions are often used to avoid XSS and the logical thing would be that we use the same technique in javascript to escape the HTML. However, this is not a technique that we should use in javascript as what we really need is to avoid direct injection into the code.<\/p>\n\n\n\n<p>The best thing to do is create DOM elements programmatically and insert them into the DOM. This means that the use of .html (), .innerHTML, and other related functions should be avoided.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What JavaScript can do<\/h2>\n\n\n\n<p>Javascript is actually a key and fundamental piece in a multitude of \u201chacking\u201d techniques, it has a place in Phising techniques (identity theft), advanced techniques in attacks such as Cross site Scripting XSS (Session theft) and a multitude of techniques that we will describe when we have the foundations to understand how they work and how they are used.<\/p>\n\n\n\n<p>As you may have noticed, any program that interacts directly with the user is a threat to them. When you are able to give orders to someone&#8217;s PC without being \u201cauthorized\u201d then you are gaining control over their machine. Javascript does exactly this, command the user&#8217;s browser; normally to improve your experience when browsing a website, but as we all know these technologies, it has also been used to cause damage by undesirable people on the victim&#8217;s computer.<\/p>\n\n\n\n<p>Over the years, browsers have evolved, gaining in security and that said and thanks to the efforts of people dedicated to security they manage to avoid those scripts made in Javascript that try to violate the security of the computer, however, and in parallel Plugins have also been developed for browsers that prevent any Javascript code from being executed on the computer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Javascript is an interpreted programming language, it is not compiled, that is, it is read and interpreted directly by the browser as source code when it reads the page. In programming it is always very important to take security into account when writing code and one of the main points that we must take into [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1183,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,8],"tags":[36,192],"class_list":["post-1182","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cybersecurity","category-java","tag-cybersecurity","tag-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What should we know about security with JavaScript - Truxgo Server Blog<\/title>\n<meta name=\"description\" content=\"JavaScript Being a capable tool for our use and development of scripts and being a sophisticated tool, we&#039;ll see how is the security on it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"es_MX\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What should we know about security with JavaScript - Truxgo Server Blog\" \/>\n<meta property=\"og:description\" content=\"JavaScript Being a capable tool for our use and development of scripts and being a sophisticated tool, we&#039;ll see how is the security on it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"Truxgo Server Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-20T01:54:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-20T20:25:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Security.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1125\" \/>\n\t<meta property=\"og:image:height\" content=\"632\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Truxgo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Truxgo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/\"},\"author\":{\"name\":\"Truxgo\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#\\\/schema\\\/person\\\/8b409c26449db6aa09724b45331e333e\"},\"headline\":\"What should we know about security with JavaScript\",\"datePublished\":\"2020-11-20T01:54:54+00:00\",\"dateModified\":\"2020-11-20T20:25:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/\"},\"wordCount\":359,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Security.png\",\"keywords\":[\"Cybersecurity\",\"Java\"],\"articleSection\":[\"Cybersecurity\",\"JAVA\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/\",\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/\",\"name\":\"What should we know about security with JavaScript - Truxgo Server Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Security.png\",\"datePublished\":\"2020-11-20T01:54:54+00:00\",\"dateModified\":\"2020-11-20T20:25:07+00:00\",\"description\":\"JavaScript Being a capable tool for our use and development of scripts and being a sophisticated tool, we'll see how is the security on it.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/#primaryimage\",\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Security.png\",\"contentUrl\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Security.png\",\"width\":1125,\"height\":632},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/what-should-we-know-about-security-with-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What should we know about security with JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/\",\"name\":\"Truxgo Server Blog\",\"description\":\"Cloud Server and Hosting Tutorials.\",\"publisher\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#organization\",\"name\":\"Truxgo Server Blog\",\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/cropped-truxgo-logo-blanco.png\",\"contentUrl\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/cropped-truxgo-logo-blanco.png\",\"width\":1250,\"height\":278,\"caption\":\"Truxgo Server Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/#\\\/schema\\\/person\\\/8b409c26449db6aa09724b45331e333e\",\"name\":\"Truxgo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g\",\"caption\":\"Truxgo\"},\"sameAs\":[\"https:\\\/\\\/truxgoservers.com\\\/blog\"],\"url\":\"https:\\\/\\\/truxgoservers.com\\\/blog\\\/author\\\/truxgo\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What should we know about security with JavaScript - Truxgo Server Blog","description":"JavaScript Being a capable tool for our use and development of scripts and being a sophisticated tool, we'll see how is the security on it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/","og_locale":"es_MX","og_type":"article","og_title":"What should we know about security with JavaScript - Truxgo Server Blog","og_description":"JavaScript Being a capable tool for our use and development of scripts and being a sophisticated tool, we'll see how is the security on it.","og_url":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/","og_site_name":"Truxgo Server Blog","article_published_time":"2020-11-20T01:54:54+00:00","article_modified_time":"2020-11-20T20:25:07+00:00","og_image":[{"width":1125,"height":632,"url":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Security.png","type":"image\/png"}],"author":"Truxgo","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Truxgo","Tiempo de lectura":"2 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/#article","isPartOf":{"@id":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/"},"author":{"name":"Truxgo","@id":"https:\/\/truxgoservers.com\/blog\/#\/schema\/person\/8b409c26449db6aa09724b45331e333e"},"headline":"What should we know about security with JavaScript","datePublished":"2020-11-20T01:54:54+00:00","dateModified":"2020-11-20T20:25:07+00:00","mainEntityOfPage":{"@id":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/"},"wordCount":359,"commentCount":2,"publisher":{"@id":"https:\/\/truxgoservers.com\/blog\/#organization"},"image":{"@id":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Security.png","keywords":["Cybersecurity","Java"],"articleSection":["Cybersecurity","JAVA"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/","url":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/","name":"What should we know about security with JavaScript - Truxgo Server Blog","isPartOf":{"@id":"https:\/\/truxgoservers.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/#primaryimage"},"image":{"@id":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Security.png","datePublished":"2020-11-20T01:54:54+00:00","dateModified":"2020-11-20T20:25:07+00:00","description":"JavaScript Being a capable tool for our use and development of scripts and being a sophisticated tool, we'll see how is the security on it.","breadcrumb":{"@id":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/#primaryimage","url":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Security.png","contentUrl":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/11\/Security.png","width":1125,"height":632},{"@type":"BreadcrumbList","@id":"https:\/\/truxgoservers.com\/blog\/what-should-we-know-about-security-with-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/truxgoservers.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What should we know about security with JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/truxgoservers.com\/blog\/#website","url":"https:\/\/truxgoservers.com\/blog\/","name":"Truxgo Server Blog","description":"Cloud Server and Hosting Tutorials.","publisher":{"@id":"https:\/\/truxgoservers.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truxgoservers.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/truxgoservers.com\/blog\/#organization","name":"Truxgo Server Blog","url":"https:\/\/truxgoservers.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/truxgoservers.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/08\/cropped-truxgo-logo-blanco.png","contentUrl":"https:\/\/truxgoservers.com\/blog\/wp-content\/uploads\/2020\/08\/cropped-truxgo-logo-blanco.png","width":1250,"height":278,"caption":"Truxgo Server Blog"},"image":{"@id":"https:\/\/truxgoservers.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/truxgoservers.com\/blog\/#\/schema\/person\/8b409c26449db6aa09724b45331e333e","name":"Truxgo","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/secure.gravatar.com\/avatar\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/52691a61c58e68677ed4860007c1bb03b14eabe7350747ab3fad3e17825b4b96?s=96&d=mm&r=g","caption":"Truxgo"},"sameAs":["https:\/\/truxgoservers.com\/blog"],"url":"https:\/\/truxgoservers.com\/blog\/author\/truxgo\/"}]}},"_links":{"self":[{"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/posts\/1182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/comments?post=1182"}],"version-history":[{"count":3,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/posts\/1182\/revisions"}],"predecessor-version":[{"id":1187,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/posts\/1182\/revisions\/1187"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/media\/1183"}],"wp:attachment":[{"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/media?parent=1182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/categories?post=1182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truxgoservers.com\/blog\/wp-json\/wp\/v2\/tags?post=1182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}