Quantcast
Channel: Security Vulnerability
Viewing all articles
Browse latest Browse all 317

in server - how Sanitize json comes from ajax

$
0
0

hello

net.4. web form - web method;

in server - how Sanitize json comes from ajax?

i need to strip all html tags and to validate its a valid json.

(at the server i parse the json to dynamic and than to hard type)

i have tried to use 

Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment(data)

but it not strip the tag just rewrite it on a different encoding..

for example 

HttpUtility.HtmlDecode(Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment("<script src=alert()"))

// will give you:
// <script src=alert()

at the end i need to parse the json to server object..

thanks

 

thanks


Viewing all articles
Browse latest Browse all 317

Trending Articles