In a Frappe app, much of the security lives outside the code you are reading. The framework decides what is reachable over HTTP. Roles live in each DocType's JSON. And some of the most common calls skip permission checks on purpose. An audit that reads the Python as plain Python misses this. Start with what Frappe does.
| What Frappe does | Why it matters |
|---|---|
A function marked @frappe.whitelist() is served at /api/method/<dotted.path>. The request's fields become its arguments. | Every whitelisted function is an endpoint, and its arguments are user input. |
allow_guest=True serves it to visitors who are not signed in. | A guest method that loads or changes a record the caller names is open to the internet. |
frappe.get_all, frappe.get_doc and frappe.db.* do not check the caller's permissions. frappe.get_list does. | A method that passes the caller's value to get_doc reads any document the caller names. |
ignore_permissions=True turns permission checks off for that call. | Fine in a background job. Risky in a method a request reaches. |
A document class's has_permission is called with the permission type first. | An override written as has_permission(self, user) receives the permission type as the user, so its check never does what it says. |
A document name may hold any character except < and >, and anyone with write access may rename a document whose DocType allows renaming. | A name printed inside a quoted HTML attribute can carry a double quote, and so stored XSS. |
Text fields are cleaned with an HTML allowlist on save, but only when the value holds < or >. | Text in an element is usually safe. The same value inside a quoted attribute or a script string is not covered. |
Each fact comes from Frappe 15's own source: frappe/handler.py, frappe/__init__.py, frappe/model/document.py, naming.py, rename_doc.py and base_document.py.
Vybscan understands Frappe apps. It finds whitelisted methods that read or change records without a permission check, guest methods open to the internet, and unsafe SQL, templates and outbound requests. It checks every pull request and push, together with the rest of the code, the dependencies and leaked keys, and installs as a GitHub App or connects to GitLab with no CI to set up.
Only after a permission check. get_doc loads the document whatever the caller's role. Call frappe.has_permission(doctype, "read", name, throw=True) first, or doc.check_permission("read") after loading it.
Yes. get_list applies the caller's role and user permissions. get_all is get_list with permissions ignored, so use it only where every caller may see every row.
No. They look for frappe.whitelist and Frappe's own API, so a Django or Flask app is not affected.
Whitelisted and guest methods, permission calls, SQL, templates, outbound requests and code evaluation in Frappe apps, plus the rest of the code, dependencies and secrets, on every pull request and push. It installs as a GitHub App or connects to GitLab.
Vybscan checks whitelisted methods, guest access and permission calls on every pull request.
Try Vybscan →