Giter Site home page Giter Site logo

Invalid JSON after XSS changes about elsa HOT 1 CLOSED

mcholste avatar mcholste commented on August 23, 2024
Invalid JSON after XSS changes

from elsa.

Comments (1)

mcholste avatar mcholste commented on August 23, 2024

I finally merged this, hopefully it's better now.

On Sat, Jan 31, 2015 at 11:25 AM, kb [email protected] wrote:

I'm experiencing the following after applying the changes to remedy XSS
found in commit 57f9ff7
57f9ff7
:

If viewing results in non-grid view, clicking on Info causes a "JSON error
parsing response: [object Object]" error in the browser, and the web log
has the following:

"
ERROR ... elsa/web/lib/View.pm (161) View::catch ...
... Invalid JSON args ...
'q' => '...b.a.s.e.6.4..b.a.s.e.6.4... ...b.a.s.e.6.4..b.a.s.e.6.4.....=='
... invalid character encountered while parsing JSON string, at character
offset ...
... at /usr/local/elsa/web/lib/Controller.pm line 1914.
... at /usr/local/elsa/web/lib/Controller.pm line 1916

"

It's breaking at line 1910, within of Controller.pm:

$decode = $self->json->decode(decode_base64($args->{q}));

The base64 encoded sData coming from the browser has a space in it.
Running the version of elsa.js before this fix has a plus sign instead.

I was able to solve my problem by adding "$args->{q} =~ s/ /+/g;" near the
top of subroutine get_log_info:
sub get_log_info {
my ($self, $args, $cb) = @_;
my $user = $args->{user};
$args->{q} =~ s/ /+/g; ### <----- NEW LINE OF CODE

my $decode;
eval {
$decode = $self->json->decode(decode_base64($args->{q}));
};

I created a pull request, but I'm not sure if it's the best solution, or
place for the solution.


Reply to this email directly or view it on GitHub
#5.

from elsa.

Related Issues (20)

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.