Access to the `ctypes` global warning occurs when validate file

Access to the ctypes global

Warning: Insufficiently meticulous use of ctypes can lead to serious, and often exploitable, errors. The use of bundled binary code, or access to system libraries, may allow for add-ons to perform unsafe operations. All ctypes use must be carefully reviewed by a qualified reviewer.

A post was merged into an existing topic: Got this warning when I verify my Addon “Access to the ctypes global”

It says what it says. It is a warning to you that you need to take care since ctypes are so powerful, but mostly it is a flag to the reviewer that they have to take a close look at it.

1 Like

How to use ctypes in particular scope? I tried to use in function / block scope, but got different warnings.

I’m using jsctypes to call to NativeAPIs (C code) and it is working and valid for firefox version < 43. I validate the Addon Jar file in Mozilla portal and it gave me lot of warning… says…

Access to the "ctypes" global
Warning: Insufficiently meticulous use of ctypes can lead to serious, and often exploitable, errors. The use of bundled binary code, or access to system libraries, may allow for add-ons to perform unsafe operations. All ctypes use must be carefully reviewed by a qualified reviewer.

in the line

ctypes.open("user32.dll")

and every where I call the NativeAPI

lib.declare("InitData")

Do I really care about this warning? Does the reviewer ignore this warning and pass my addon?

Reviewers take a look at it to make sure you aren’t doing bad stuff :slight_smile: