0

I have the code below in flask using SQLAlchemy and marshmallow:

def search(category_name, version):
    library = Library.query.filter(Library.category == category_name).filter(Library.subversion == version).all()

    library_schema = LibrarySchema(many=True)
    data = library_schema.dump(library)
    return data

How can I be sure the code is not vulnerable to SQL injection?

davidism
  • 121,510
  • 29
  • 395
  • 339
hd.
  • 17,596
  • 46
  • 115
  • 165

1 Answers1

0

The quickest way to be check if you're vulnerable is to send "X' OR '1' = '1'--" as category_name / version to that function and see what happens.

In other words, perform the sql injection yourself.

c8999c 3f964f64
  • 1,430
  • 1
  • 12
  • 25