javascript - Issue with crossorigin anonymous failing to load images -


reference: prevent http basic authentication displaying prompt images

in order protect user-generated content potential "exploit", added crossorigin="anonymous" [img] bbcodes.

well, worked in ie11: when tested exploit, image no longer triggered authentication dialog (tested cache disabled , different urls measure).

but in chrome, exploit doesn't work... because images aren't being loaded @ all. instead i'm getting apparently common error:

image origin 'xxxxx' has been blocked loading cross-origin resource sharing policy: no 'access-control-allow-origin' header present on requested resource. origin 'yyyyy' therefore not allowed access.

maybe understanding wrong, thought "anonymous" value of attribute allow work.

am missing something, , if other options there protect against issue?

firstly, per understanding, mean images didn't load in ie. perfect! that's how has work.

secondly(& finally), behaviour of chrome perfect well.

process/details:

the server not give credentials origin site (by setting access-control-allow-origin anonymous), image tainted , usage restricted.

now, if have cross-origin image can copy canvas "taints" canvas prevents reading (so cannot "steal" or "download" images). however, using cors server image stored can tell browser cross-origin access permitted , can access image data through canvas.

when header not same origin i.e., if resource fetched without cors request (i.e. without sending origin: http header), , becomes invalid, then, handled if enumerated keyword anonymous used.

so guess null either same not being present or being invalid in case handled anonymous.

so, see error in chrome means doing ie doing.


some references can help-

though not direct answer, but, helpful links-

hope helps! :) happy coding!


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -