Preventing XSS in Input $_POST Form












0












$begingroup$


I tried to prevent XSS-Attacks by adding



// prevent XSS
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);


to the top of the .PHP File. It works, but I don't think that this is the best practise.



What I need to do is improve the way this Input, handles the data.



    if (empty($_POST['telefonnummer']) || !isset($_POST['telefonnummer'])) {
$this->setStatusMessage($translator->translate('Bitte geben Sie Ihre Telefonnummer ein.'));
$this->setStatus(KDatabase::STATUS_FAILED);

return false;
}else{
$this->telefonnummer = $_POST['telefonnummer'];
}









share|improve this question









$endgroup$

















    0












    $begingroup$


    I tried to prevent XSS-Attacks by adding



    // prevent XSS
    $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
    $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);


    to the top of the .PHP File. It works, but I don't think that this is the best practise.



    What I need to do is improve the way this Input, handles the data.



        if (empty($_POST['telefonnummer']) || !isset($_POST['telefonnummer'])) {
    $this->setStatusMessage($translator->translate('Bitte geben Sie Ihre Telefonnummer ein.'));
    $this->setStatus(KDatabase::STATUS_FAILED);

    return false;
    }else{
    $this->telefonnummer = $_POST['telefonnummer'];
    }









    share|improve this question









    $endgroup$















      0












      0








      0


      1



      $begingroup$


      I tried to prevent XSS-Attacks by adding



      // prevent XSS
      $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
      $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);


      to the top of the .PHP File. It works, but I don't think that this is the best practise.



      What I need to do is improve the way this Input, handles the data.



          if (empty($_POST['telefonnummer']) || !isset($_POST['telefonnummer'])) {
      $this->setStatusMessage($translator->translate('Bitte geben Sie Ihre Telefonnummer ein.'));
      $this->setStatus(KDatabase::STATUS_FAILED);

      return false;
      }else{
      $this->telefonnummer = $_POST['telefonnummer'];
      }









      share|improve this question









      $endgroup$




      I tried to prevent XSS-Attacks by adding



      // prevent XSS
      $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
      $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);


      to the top of the .PHP File. It works, but I don't think that this is the best practise.



      What I need to do is improve the way this Input, handles the data.



          if (empty($_POST['telefonnummer']) || !isset($_POST['telefonnummer'])) {
      $this->setStatusMessage($translator->translate('Bitte geben Sie Ihre Telefonnummer ein.'));
      $this->setStatus(KDatabase::STATUS_FAILED);

      return false;
      }else{
      $this->telefonnummer = $_POST['telefonnummer'];
      }






      php






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 11 '18 at 10:19









      YoKoGFXYoKoGFX

      63




      63






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          Find purpose-built libraries which have active maintained. For example, anti-xss:



          $harm_string = "Hello, i try to <script>alert('Hack');</script> your site";
          $harmless_string = $antiXss->xss_clean($harm_string);

          $harm_string = "<IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>";
          $harmless_string = $antiXss->xss_clean($harm_string);

          $harm_string = "<a href=' javascript:alert(1)'>CLICK</a>";
          $harmless_string = $antiXss->xss_clean($harm_string);

          $harm_string = "<a href="u0001javau0003script:alert(1)">CLICK<a>";
          $harmless_string = $antiXss->xss_clean($harm_string);

          $harm_string = '<li style="list-style-image: url(javascript:alert(0))">';
          $harmless_string = $antiXss->xss_clean($harm_string);

          $harm_string = '<li style="list-style-image: url(javascript:alert(0))">';
          $antiXss->removeEvilAttributes(array('style')); // allow style-attributes
          $harmless_string = $antiXss->xss_clean($harm_string);

          $harm_string = "x3cscript src=http://www.example.com/malicious-code.jsx3ex3c/scriptx3e";
          $harmless_string = $antiXss->xss_clean($harm_string);

          $harm_string = "<iframe width="560" onclick="alert('xss')" height="315" src="https://www.youtube.com/embed/foobar?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>";

          $antiXss->removeEvilHtmlTags(array('iframe'));


          And a UTF8 library for data you are sending:



          UTF8::json_enocde(array(1, '¥', 'ä')); // '[1,"u00a5","u00e4"]'

          UTF8::html_encode('中文空白'); // '中文空白'

          UTF8::utf8_decode(UTF8::utf8_encode('-ABC-中文空白-')); // '-ABC-中文空白-'


          Implement Content Security Policy(CSP) on the web server as well. For example:



          default-src 'self' https:; connect-src 'self' https: http:; font-src 'self' https:; frame-src *; img-src
          'self' https: http: data:; media-src 'self' https:; object-src 'self' https:; script-src 'sha256-q590j1fW
          +aERb666H10h55ePy0sxRjUYCiOmJPftXDs=' 'self' https: 'unsafe-eval' 'unsafe-inline' http:; style-src 'self'
          https: 'unsafe-inline' http:; report-uri /tracking/csp?action=listing_frame&controller=embed&req_uuid
          =cff37d5d-4c12-4c8b-b288-1ce0d103a25c&version=c7fc601874a5350c79eceb33ba6d4c09a433035f;




          default-src is set to 'self' which means it's setting all CSP rules to only allow src attribute from a same-origin. In short, you should only be able to load src from a relative endpoint.
          frame-src is set to wildcard (*) so we can load external src links in frames (iframe, frame, frameset). Because we're injecting HTML past the body element, we cannot use frame or frameset. The WAF has made it next to impossible to use iframe.
          script-src has 'self' supplied after the sha256 hashed script for unsafe-inline and unsafe-eval, but https does not have 'self' supplied meaning we can load external scripts for execution.




          References




          • anti-xss repo: public function testXssClean()


          • PayloadsAllTheThings/XSS injection at master · swisskyrepo/PayloadsAllTheThings


          • UTF8 can be tricky – especially with PHP – DerEuroMark


          • voku/portable-utf8: 🉑 Portable UTF-8 library - performance optimized (unicode) string functions for php.


          • Airbnb – When Bypassing JSON Encoding, XSS Filter, WAF, CSP, and Auditor turns into Eight Vulnerabilities | Brett Buerhaus


          • How to protect PHP application from XSS attacks: CSP 3 nonce | PHP & Symfony Tips






          share









          $endgroup$













            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
            });
            });
            }, "mathjax-editing");

            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "196"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f189334%2fpreventing-xss-in-input-post-form%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0












            $begingroup$

            Find purpose-built libraries which have active maintained. For example, anti-xss:



            $harm_string = "Hello, i try to <script>alert('Hack');</script> your site";
            $harmless_string = $antiXss->xss_clean($harm_string);

            $harm_string = "<IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>";
            $harmless_string = $antiXss->xss_clean($harm_string);

            $harm_string = "<a href=' javascript:alert(1)'>CLICK</a>";
            $harmless_string = $antiXss->xss_clean($harm_string);

            $harm_string = "<a href="u0001javau0003script:alert(1)">CLICK<a>";
            $harmless_string = $antiXss->xss_clean($harm_string);

            $harm_string = '<li style="list-style-image: url(javascript:alert(0))">';
            $harmless_string = $antiXss->xss_clean($harm_string);

            $harm_string = '<li style="list-style-image: url(javascript:alert(0))">';
            $antiXss->removeEvilAttributes(array('style')); // allow style-attributes
            $harmless_string = $antiXss->xss_clean($harm_string);

            $harm_string = "x3cscript src=http://www.example.com/malicious-code.jsx3ex3c/scriptx3e";
            $harmless_string = $antiXss->xss_clean($harm_string);

            $harm_string = "<iframe width="560" onclick="alert('xss')" height="315" src="https://www.youtube.com/embed/foobar?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>";

            $antiXss->removeEvilHtmlTags(array('iframe'));


            And a UTF8 library for data you are sending:



            UTF8::json_enocde(array(1, '¥', 'ä')); // '[1,"u00a5","u00e4"]'

            UTF8::html_encode('中文空白'); // '中文空白'

            UTF8::utf8_decode(UTF8::utf8_encode('-ABC-中文空白-')); // '-ABC-中文空白-'


            Implement Content Security Policy(CSP) on the web server as well. For example:



            default-src 'self' https:; connect-src 'self' https: http:; font-src 'self' https:; frame-src *; img-src
            'self' https: http: data:; media-src 'self' https:; object-src 'self' https:; script-src 'sha256-q590j1fW
            +aERb666H10h55ePy0sxRjUYCiOmJPftXDs=' 'self' https: 'unsafe-eval' 'unsafe-inline' http:; style-src 'self'
            https: 'unsafe-inline' http:; report-uri /tracking/csp?action=listing_frame&controller=embed&req_uuid
            =cff37d5d-4c12-4c8b-b288-1ce0d103a25c&version=c7fc601874a5350c79eceb33ba6d4c09a433035f;




            default-src is set to 'self' which means it's setting all CSP rules to only allow src attribute from a same-origin. In short, you should only be able to load src from a relative endpoint.
            frame-src is set to wildcard (*) so we can load external src links in frames (iframe, frame, frameset). Because we're injecting HTML past the body element, we cannot use frame or frameset. The WAF has made it next to impossible to use iframe.
            script-src has 'self' supplied after the sha256 hashed script for unsafe-inline and unsafe-eval, but https does not have 'self' supplied meaning we can load external scripts for execution.




            References




            • anti-xss repo: public function testXssClean()


            • PayloadsAllTheThings/XSS injection at master · swisskyrepo/PayloadsAllTheThings


            • UTF8 can be tricky – especially with PHP – DerEuroMark


            • voku/portable-utf8: 🉑 Portable UTF-8 library - performance optimized (unicode) string functions for php.


            • Airbnb – When Bypassing JSON Encoding, XSS Filter, WAF, CSP, and Auditor turns into Eight Vulnerabilities | Brett Buerhaus


            • How to protect PHP application from XSS attacks: CSP 3 nonce | PHP & Symfony Tips






            share









            $endgroup$


















              0












              $begingroup$

              Find purpose-built libraries which have active maintained. For example, anti-xss:



              $harm_string = "Hello, i try to <script>alert('Hack');</script> your site";
              $harmless_string = $antiXss->xss_clean($harm_string);

              $harm_string = "<IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>";
              $harmless_string = $antiXss->xss_clean($harm_string);

              $harm_string = "<a href=' javascript:alert(1)'>CLICK</a>";
              $harmless_string = $antiXss->xss_clean($harm_string);

              $harm_string = "<a href="u0001javau0003script:alert(1)">CLICK<a>";
              $harmless_string = $antiXss->xss_clean($harm_string);

              $harm_string = '<li style="list-style-image: url(javascript:alert(0))">';
              $harmless_string = $antiXss->xss_clean($harm_string);

              $harm_string = '<li style="list-style-image: url(javascript:alert(0))">';
              $antiXss->removeEvilAttributes(array('style')); // allow style-attributes
              $harmless_string = $antiXss->xss_clean($harm_string);

              $harm_string = "x3cscript src=http://www.example.com/malicious-code.jsx3ex3c/scriptx3e";
              $harmless_string = $antiXss->xss_clean($harm_string);

              $harm_string = "<iframe width="560" onclick="alert('xss')" height="315" src="https://www.youtube.com/embed/foobar?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>";

              $antiXss->removeEvilHtmlTags(array('iframe'));


              And a UTF8 library for data you are sending:



              UTF8::json_enocde(array(1, '¥', 'ä')); // '[1,"u00a5","u00e4"]'

              UTF8::html_encode('中文空白'); // '中文空白'

              UTF8::utf8_decode(UTF8::utf8_encode('-ABC-中文空白-')); // '-ABC-中文空白-'


              Implement Content Security Policy(CSP) on the web server as well. For example:



              default-src 'self' https:; connect-src 'self' https: http:; font-src 'self' https:; frame-src *; img-src
              'self' https: http: data:; media-src 'self' https:; object-src 'self' https:; script-src 'sha256-q590j1fW
              +aERb666H10h55ePy0sxRjUYCiOmJPftXDs=' 'self' https: 'unsafe-eval' 'unsafe-inline' http:; style-src 'self'
              https: 'unsafe-inline' http:; report-uri /tracking/csp?action=listing_frame&controller=embed&req_uuid
              =cff37d5d-4c12-4c8b-b288-1ce0d103a25c&version=c7fc601874a5350c79eceb33ba6d4c09a433035f;




              default-src is set to 'self' which means it's setting all CSP rules to only allow src attribute from a same-origin. In short, you should only be able to load src from a relative endpoint.
              frame-src is set to wildcard (*) so we can load external src links in frames (iframe, frame, frameset). Because we're injecting HTML past the body element, we cannot use frame or frameset. The WAF has made it next to impossible to use iframe.
              script-src has 'self' supplied after the sha256 hashed script for unsafe-inline and unsafe-eval, but https does not have 'self' supplied meaning we can load external scripts for execution.




              References




              • anti-xss repo: public function testXssClean()


              • PayloadsAllTheThings/XSS injection at master · swisskyrepo/PayloadsAllTheThings


              • UTF8 can be tricky – especially with PHP – DerEuroMark


              • voku/portable-utf8: 🉑 Portable UTF-8 library - performance optimized (unicode) string functions for php.


              • Airbnb – When Bypassing JSON Encoding, XSS Filter, WAF, CSP, and Auditor turns into Eight Vulnerabilities | Brett Buerhaus


              • How to protect PHP application from XSS attacks: CSP 3 nonce | PHP & Symfony Tips






              share









              $endgroup$
















                0












                0








                0





                $begingroup$

                Find purpose-built libraries which have active maintained. For example, anti-xss:



                $harm_string = "Hello, i try to <script>alert('Hack');</script> your site";
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = "<IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>";
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = "<a href=' javascript:alert(1)'>CLICK</a>";
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = "<a href="u0001javau0003script:alert(1)">CLICK<a>";
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = '<li style="list-style-image: url(javascript:alert(0))">';
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = '<li style="list-style-image: url(javascript:alert(0))">';
                $antiXss->removeEvilAttributes(array('style')); // allow style-attributes
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = "x3cscript src=http://www.example.com/malicious-code.jsx3ex3c/scriptx3e";
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = "<iframe width="560" onclick="alert('xss')" height="315" src="https://www.youtube.com/embed/foobar?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>";

                $antiXss->removeEvilHtmlTags(array('iframe'));


                And a UTF8 library for data you are sending:



                UTF8::json_enocde(array(1, '¥', 'ä')); // '[1,"u00a5","u00e4"]'

                UTF8::html_encode('中文空白'); // '中文空白'

                UTF8::utf8_decode(UTF8::utf8_encode('-ABC-中文空白-')); // '-ABC-中文空白-'


                Implement Content Security Policy(CSP) on the web server as well. For example:



                default-src 'self' https:; connect-src 'self' https: http:; font-src 'self' https:; frame-src *; img-src
                'self' https: http: data:; media-src 'self' https:; object-src 'self' https:; script-src 'sha256-q590j1fW
                +aERb666H10h55ePy0sxRjUYCiOmJPftXDs=' 'self' https: 'unsafe-eval' 'unsafe-inline' http:; style-src 'self'
                https: 'unsafe-inline' http:; report-uri /tracking/csp?action=listing_frame&controller=embed&req_uuid
                =cff37d5d-4c12-4c8b-b288-1ce0d103a25c&version=c7fc601874a5350c79eceb33ba6d4c09a433035f;




                default-src is set to 'self' which means it's setting all CSP rules to only allow src attribute from a same-origin. In short, you should only be able to load src from a relative endpoint.
                frame-src is set to wildcard (*) so we can load external src links in frames (iframe, frame, frameset). Because we're injecting HTML past the body element, we cannot use frame or frameset. The WAF has made it next to impossible to use iframe.
                script-src has 'self' supplied after the sha256 hashed script for unsafe-inline and unsafe-eval, but https does not have 'self' supplied meaning we can load external scripts for execution.




                References




                • anti-xss repo: public function testXssClean()


                • PayloadsAllTheThings/XSS injection at master · swisskyrepo/PayloadsAllTheThings


                • UTF8 can be tricky – especially with PHP – DerEuroMark


                • voku/portable-utf8: 🉑 Portable UTF-8 library - performance optimized (unicode) string functions for php.


                • Airbnb – When Bypassing JSON Encoding, XSS Filter, WAF, CSP, and Auditor turns into Eight Vulnerabilities | Brett Buerhaus


                • How to protect PHP application from XSS attacks: CSP 3 nonce | PHP & Symfony Tips






                share









                $endgroup$



                Find purpose-built libraries which have active maintained. For example, anti-xss:



                $harm_string = "Hello, i try to <script>alert('Hack');</script> your site";
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = "<IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>";
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = "<a href=' javascript:alert(1)'>CLICK</a>";
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = "<a href="u0001javau0003script:alert(1)">CLICK<a>";
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = '<li style="list-style-image: url(javascript:alert(0))">';
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = '<li style="list-style-image: url(javascript:alert(0))">';
                $antiXss->removeEvilAttributes(array('style')); // allow style-attributes
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = "x3cscript src=http://www.example.com/malicious-code.jsx3ex3c/scriptx3e";
                $harmless_string = $antiXss->xss_clean($harm_string);

                $harm_string = "<iframe width="560" onclick="alert('xss')" height="315" src="https://www.youtube.com/embed/foobar?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>";

                $antiXss->removeEvilHtmlTags(array('iframe'));


                And a UTF8 library for data you are sending:



                UTF8::json_enocde(array(1, '¥', 'ä')); // '[1,"u00a5","u00e4"]'

                UTF8::html_encode('中文空白'); // '中文空白'

                UTF8::utf8_decode(UTF8::utf8_encode('-ABC-中文空白-')); // '-ABC-中文空白-'


                Implement Content Security Policy(CSP) on the web server as well. For example:



                default-src 'self' https:; connect-src 'self' https: http:; font-src 'self' https:; frame-src *; img-src
                'self' https: http: data:; media-src 'self' https:; object-src 'self' https:; script-src 'sha256-q590j1fW
                +aERb666H10h55ePy0sxRjUYCiOmJPftXDs=' 'self' https: 'unsafe-eval' 'unsafe-inline' http:; style-src 'self'
                https: 'unsafe-inline' http:; report-uri /tracking/csp?action=listing_frame&controller=embed&req_uuid
                =cff37d5d-4c12-4c8b-b288-1ce0d103a25c&version=c7fc601874a5350c79eceb33ba6d4c09a433035f;




                default-src is set to 'self' which means it's setting all CSP rules to only allow src attribute from a same-origin. In short, you should only be able to load src from a relative endpoint.
                frame-src is set to wildcard (*) so we can load external src links in frames (iframe, frame, frameset). Because we're injecting HTML past the body element, we cannot use frame or frameset. The WAF has made it next to impossible to use iframe.
                script-src has 'self' supplied after the sha256 hashed script for unsafe-inline and unsafe-eval, but https does not have 'self' supplied meaning we can load external scripts for execution.




                References




                • anti-xss repo: public function testXssClean()


                • PayloadsAllTheThings/XSS injection at master · swisskyrepo/PayloadsAllTheThings


                • UTF8 can be tricky – especially with PHP – DerEuroMark


                • voku/portable-utf8: 🉑 Portable UTF-8 library - performance optimized (unicode) string functions for php.


                • Airbnb – When Bypassing JSON Encoding, XSS Filter, WAF, CSP, and Auditor turns into Eight Vulnerabilities | Brett Buerhaus


                • How to protect PHP application from XSS attacks: CSP 3 nonce | PHP & Symfony Tips







                share











                share


                share










                answered 5 mins ago









                Paul SweattePaul Sweatte

                1764




                1764






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Code Review Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f189334%2fpreventing-xss-in-input-post-form%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    404 Error Contact Form 7 ajax form submitting

                    How to know if a Active Directory user can login interactively

                    TypeError: fit_transform() missing 1 required positional argument: 'X'