Skip to content

Console Log Instrumentation breaks on foreign objects #1219

Description

@mitsuhiko

Currently our console.log and friends patchers assume that the call of obj.toString() is safe. That's demonstrably not the case if the objects logged are from an insecure foreign window (SecurityError Blocked a frame with origin "blah" from accessing a cross-origin frame.).

Example where we do this:

https://github.com/getsentry/raven-js/blob/b532909585d6ead92c612c0acfaee86010e5acd3/src/console.js#L14

Should probably become something like this:

args.map((obj)=>{try{returnString(obj);}catch(err){return'[object cannot be stringified]';}}).join(' ');

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions