{"id":47,"date":"2010-01-21T17:53:03","date_gmt":"2010-01-22T01:53:03","guid":{"rendered":"http:\/\/michael.lavaveshkul.com\/blog\/?p=47"},"modified":"2019-02-03T00:03:28","modified_gmt":"2019-02-03T08:03:28","slug":"second-post","status":"publish","type":"post","link":"https:\/\/michael.lavaveshkul.com\/blog\/2010\/01\/second-post\/","title":{"rendered":"Second Post!"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Told you I don&#8217;t update often&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anyway, I did a small update to that validation project. Apparently, it allowed for <a href=\"http:\/\/en.wikipedia.org\/wiki\/Cross-site_scripting\">xss<\/a> attacks. Good thing there&#8217;s nothing valuable to get from my site (I think). So, for example, if I was to enter the following in the sitemap text box<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>blah.xml \"\/&gt;&lt;script type=\"text\/javascript\"&gt;alert(\"hi\");&lt;\/script&gt;&lt;input type=\"hidden<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">an alert would come up that says &#8220;hi&#8221;. I think I solved the problem by using <a href=\"http:\/\/php.net\/manual\/en\/function.htmlspecialchars.php\">htmlspecialchars<\/a>. And just to be safe, I used the same solution for displaying the urls in the table. You can try it <a href=\"\/\/michael.lavaveshkul.com\/projects\/validation\/validator.php?sitemap=http%3A%2F%2Fmichael.lavaveshkul.com%2Fprojects%2Fvalidation%2Fexample.php%3Fm%3Dsitemap\">here<\/a>. Unfortunately, I don&#8217;t have a lot of experience in xss. Is there anything I&#8217;m missing or should be more aware of?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Told you I don&#8217;t update often&#8230; Anyway, I did a small update to that validation project. Apparently, it allowed for xss attacks. Good thing there&#8217;s nothing valuable to get from my site (I think). So, for example, if I was to enter the following in the sitemap text box blah.xml &#8220;\/&gt;&lt;script type=&#8221;text\/javascript&#8221;&gt;alert(&#8220;hi&#8221;);&lt;\/script&gt;&lt;input type=&#8221;hidden an alert &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/michael.lavaveshkul.com\/blog\/2010\/01\/second-post\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Second Post!&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-47","post","type-post","status-publish","format-standard","hentry","category-project"],"_links":{"self":[{"href":"https:\/\/michael.lavaveshkul.com\/blog\/wp-json\/wp\/v2\/posts\/47","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michael.lavaveshkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michael.lavaveshkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michael.lavaveshkul.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michael.lavaveshkul.com\/blog\/wp-json\/wp\/v2\/comments?post=47"}],"version-history":[{"count":9,"href":"https:\/\/michael.lavaveshkul.com\/blog\/wp-json\/wp\/v2\/posts\/47\/revisions"}],"predecessor-version":[{"id":799,"href":"https:\/\/michael.lavaveshkul.com\/blog\/wp-json\/wp\/v2\/posts\/47\/revisions\/799"}],"wp:attachment":[{"href":"https:\/\/michael.lavaveshkul.com\/blog\/wp-json\/wp\/v2\/media?parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michael.lavaveshkul.com\/blog\/wp-json\/wp\/v2\/categories?post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michael.lavaveshkul.com\/blog\/wp-json\/wp\/v2\/tags?post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}