Giter Club home page Giter Club logo

spring-jackson-owasp's Introduction

OWASP JSON

This demonstrates how to configure Spring applications to encode JSON rather than simply escaping it as recommended by OWASP XSS cheat sheet. Specifically it states JavaScript should be encoded as

Except for alphanumeric characters, escape all characters with the \uXXXX unicode escaping format (X = Integer).
  • spring-jackson-owasp-boot - A Spring Boot application that escaping all non-alphanumeric characters with unicode with Jackson

  • spring-jackson-owasp-java - A Spring Java configuration application that escaping all non-alphanumeric characters with unicode with Jackson

  • spring-jackson-owasp-xml - A Spring XML configuration application that escaping all non-alphanumeric characters with unicode with Jackson

spring-jackson-owasp's People

Stargazers

 avatar Ahmed  Raaj avatar mytianya avatar  avatar raed avatar Jeongmuk Lim avatar cicadabear avatar Paul Escarcena avatar Renann Prado avatar shpodg avatar Yaniv Nahoum avatar dongfeng avatar  avatar Helixcs avatar Atif Riaz avatar Wei-Ting Chen avatar Roman Danilin avatar uzkitio avatar Thomas Skjølberg avatar  avatar  avatar  avatar Wanatchapong avatar Thomas Darimont avatar Gabriel Mihai Ruiu avatar Venugopal Madathil avatar Paul Whelan avatar Giang Thiet avatar John Deverall avatar Hantsy Bai avatar Christopher T. Kwiatkowski avatar Sasha avatar  avatar

Watchers

Will Droste avatar Rob Winch avatar Paul Escarcena avatar jmatrix avatar  avatar

spring-jackson-owasp's Issues

encoded script value executing as script while using append function and also not able to see the encode value inside ajax call

Hi @rwinch ,

Could you please give clarification on below. im confused with some scenarios
tried with the spring-jackson-owasp-java app , when i consume the services directly in browser i get encoded response like below:

eg: http://localhost:8080/message?p="test input"

Response : {"message":"\u0022test\u0020input\u0022"}

Clarification required:

scenario 1:
But when i debug inside the java script im not able to see this encoded value ?

scenario 2:
when the services response contain with java script it will rendering as normal text while using text method( $("#output").text(data.message); ) but while using append method ( $("#output").append(data.message); ) the response is executed as script

sample response object:

{"message":"<script> window.location.href='https://localhot:8080/app/attack' </script> "}

so my question is in this application all the character are encoded in service side except alpha numeric , but event inside the ajax call we are not seeing encoded value and also the script is executed using append function , then how it will protected from xss attack? please clarify?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.