Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug1 : an heap-buffer-overflow bug of swfmill swf2xml #46

Open
ghost opened this issue Jul 1, 2018 · 0 comments
Open

bug1 : an heap-buffer-overflow bug of swfmill swf2xml #46

ghost opened this issue Jul 1, 2018 · 0 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 1, 2018

poc:
https://drive.google.com/open?id=1hBFvf2l1Jp8elvm6-HMNf_b6bqd1DzKC
asan:
https://drive.google.com/open?id=1btf-tyhwl4bzXNgidrYk96xf43RhqOO7

an interger overflow happens at line 3925 of gSWFParser.cpp

{
      int sz = len;

      data = new unsigned char[ sz ];
      r->getData( data, sz );
  }

the sz comes from len, and when len becomes a really big interger, the new will return false.
len is a private member of namespace SWF,

namespace SWF {

    template <class T>
    class IdItem : public Item {
        protected:
            IdItem() { type = 0; len = 0; }

            int getHeaderSize(int size) { return 8; }
            void writeHeader(Writer *w, Context *ctx, size_t len) { w->putByte(type); }

            void setType(int t) { type = t; }
            int getType() { return type; }

            void setLength(int l) { len = l; }
            int getLength() { return len; }

            int type;
            int len;

in the function get
Filter *Filter::get(Reader *r, int end, Context *ctx) {
the len is from
int len = end - r->getPosition();
and it will be a negative number , that's why the new operation fail.

@ghost ghost changed the title bug1 of : an heap-buffer-overflow bug of swfmill swf2xml bug1 : an heap-buffer-overflow bug of swfmill swf2xml Jul 1, 2018
@djcsdy djcsdy added the bug label Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant