Securing file uploads in ERPNext

Attachments are one of the easiest ways to move malicious or sensitive content into an ERP. This page explains the controls ERPNext gives you, where they stop, and what to add outside Frappe.

On this page

Securing file uploads in ERPNext: what the platform controls and what it leaves to you

The risk from attachments in ERPNext can be reduced with platform settings inside Frappe, but those settings cover only part of it. Invoices, purchase orders, employee records and item documents arrive from many users, and sometimes from guests or web forms, so the controls that matter most sit partly outside the application. Teams usually need this work when suppliers upload documents through a portal, when public web forms accept files, or when the site holds regulated personal or financial data that an auditor will ask about.

Inside ERPNext, the controls to review are the allowed file extensions, the maximum upload size, whether guests can upload at all, and whether a file is public or private. Each of these affects who can reach a file by URL and what a hostile file can do once it lands. Confirm the exact option names, where they live in System Settings or site configuration, and their defaults against the ERPNext version you run, since the documentation covers upload handling but names and defaults can change between releases. Test each setting with a file a supplier would realistically send and with a guest session, not only with an administrator account.

Some controls belong outside Frappe entirely: malware scanning of uploads before users open them, stripping EXIF metadata from images such as location data taken from photos, and reverse proxy limits on request size at Nginx or a load balancer. Decide who owns each control, how scanning results are recorded, and what happens to a quarantined file. Ask your implementation partner and your security team to write these decisions down before go-live, because an attachment accepted by ERPNext is a record your auditors and your incident responders will later need to explain.

Which control layer handles which upload risk

Frappe lets administrators restrict which file types can be attached and how large an upload may be. These rules run when a file reaches the application, so they stop obvious mistakes such as executable files or oversized archives entering through standard forms and the Desk. They do not inspect what a file actually contains. A file renamed to a permitted extension passes the extension check, and a valid PDF can still carry malicious content. Confirm in your version where the allowed extension list and the maximum upload size are configured, whether the list applies to every upload path including API calls, and how your web server or reverse proxy limits request sizes, since a proxy limit can reject files before Frappe sees them.

  • Extension allow lists: Limit uploads to the file types your processes need, and check whether the list is enforced on API and integration uploads, not only the Desk.
  • Size limits: Set a maximum that matches real business documents, then confirm the same ceiling is applied at the proxy and in Frappe.
  • Content blind spot: Extension and size checks do not detect malware, macros or polyglot files, so they are necessary but not sufficient.
  • Bypass paths: Check whether data import, custom scripts or third-party apps can store files without passing through the standard upload handler.

Before go-live, test a renamed executable and an oversized file through each upload path your users and integrations actually use.

Upload configuration options and when each fits

This table compares the main controls that shape attachment risk in ERPNext, from extension and size limits to guest access, file visibility, metadata handling and malware scanning. Read each row against your own document flows: the right setting depends on who uploads, what they upload and who later opens the file. Most sites need several controls together, and no single row removes the risk on its own.

OptionWhat it controlsWhen it fitsTrade-off
Allowed file extensionsWhich file types Frappe accepts as attachments on a site, so executable or script types can be blocked at upload.Sites where users only need documents, spreadsheets and images, such as purchase invoices and delivery notes.Legitimate formats used by a supplier or engineer may be refused, so finance and operations need a documented exception path. Confirm the exact setting location in your installed version.
Maximum file sizeThe largest attachment a user can upload, limiting storage growth and the size of files that must be scanned or processed.Teams with bounded document needs, or sites where large media or archives are not part of the business process.Too low a limit pushes users toward email or shared drives outside the audit trail. Confirm the default and whether the limit also applies at the web server layer.
Private versus public filesWhether an attachment is served only to authenticated users with access to the parent record, or through a public URL that anyone with the link can open.Private files for invoices, payroll, contracts and customer data. Public files only for content meant for external readers, such as product images.Public links can be shared, cached or indexed beyond the intended audience. Changing an existing file's visibility should be tested against the record permissions.
Guest or website user uploadsWhether unauthenticated visitors or portal users can submit files through web forms or the website, and what those submissions can reach.Recruitment, support or supplier onboarding forms where outside parties must send documents without an account.Anonymous uploads widen the attack surface and can fill storage. Keep these forms narrow, restrict file types and size, and review submissions before they reach business records.
EXIF and metadata strippingRemoval of embedded metadata such as camera data, location, author and editing history from images and documents before they are stored or shared.Customer photos, site inspection images or any file that leaves the organization, where metadata could expose people or locations.Stripping can alter files that need original metadata for evidence, such as forensic photos. Stripping is usually not built in, so confirm which tool or custom step would perform it.
External malware scanningInspection of uploaded files by a scanner outside Frappe, such as a dedicated antivirus or sandbox service, before users or integrations open them.Sites accepting files from outside the organization, or where attachments are opened by many users or passed to downstream systems.Scanning adds infrastructure, latency and an operational owner for signatures and alerts. Ask the scanner vendor how quarantined files are handled and whether the ERPNext record can be blocked until a verdict arrives.

How to set up upload controls in a self-hosted ERPNext site

This sequence moves from finding every place attachments enter ERPNext to proving, role by role, that the allowed files are accepted and everything else is refused. The output is a documented upload policy, a configured site, and a test record your security team can review.

  1. Inventory every attachment entry point

    List each DocType that has Attach or Attach Image fields, each child table that carries attachments, and every web form, portal page or API endpoint that accepts files. Include print formats and email inbound paths if they store documents against records. Assign an owner to each entry point. Done when the inventory covers every route a file can reach the database or file store, and each row names a business owner and a reason the path exists.

  2. Decide who may upload for each DocType

    For each entry point, record which roles need to attach files and which only need to read them. Use role permissions to grant create and write rights narrowly, and avoid granting upload rights through broad administrative roles. Confirm that a user without write access on the parent document cannot add an attachment through the attachment list. Done when every entry point has a written allow list of roles, and you have checked the attachment behavior for one role that should be blocked.

  3. Restrict extensions and maximum file size

    Set the allowed file extensions and the maximum upload size in the System Settings for your site, and confirm the web server and reverse proxy limits match them so requests fail predictably. Keep the list to the formats the business actually exchanges, and remove executable and script types. Check the current setting names and defaults in your ERPNext version before you change them. Done when a test upload of a disallowed extension and an oversized file are both refused, and the accepted limits appear in your policy document.

  4. Set files to private by default

    Review whether each attachment should be public or private. Private files require a logged-in user with access to the parent document, while public files can be reached by anyone with the link. Change the default for new uploads to private and document the few DocTypes that justify public files, such as published item images. Done when an attachment on a restricted record opens for an authorized user and returns an access error when opened from a copied link by an unauthorized user.

  5. Review guest and web form upload paths

    Check every web form, portal and guest-accessible page that accepts files, and confirm which users can reach each one. Guest uploads carry the most risk because no account is tied to the submission. Disable guest access where it is not required, require login for portal uploads where possible, and confirm the destination DocType and its permissions. Done when a session without login cannot submit a file to any page that is not explicitly approved, and the approved exceptions are listed with their owners.

  6. Add content handling for high-risk intake

    For intake from outside your organization, plan how files are inspected before people open them. Within ERPNext, Server Scripts are disabled by default from version 15 and must be enabled with the server_script_enabled setting. Frappe Cloud public shared benches do not allow them, so any custom validation in Python must run on a self-hosted bench you control or be replaced by controls outside the application. Strip image metadata such as EXIF data where your process requires it, and route high-risk files through a malware scanning service outside Frappe before a user can open them. Done when the chosen approach is documented, the server script setting state is recorded, and a test file is held or cleaned as designed.

  7. Test each role with sample files

    Prepare a set of sample files that includes allowed types, disallowed extensions, oversized files, a file with a misleading extension, and an image with location metadata. Run the set as each role, including guest and portal users, and record whether each upload succeeds, is refused, or is stored as private. Include reading and deleting attachments. Done when every role and file combination has a recorded result, and each unexpected result has a fix or an accepted-risk note signed by its owner.

Security and operational risks to plan for

Attachments in ERPNext inherit the access rules of the record they hang from, but they also leave the database, reach backups and logs, and get opened by people and systems that never went through a form. The cards below cover the exposure points that Frappe's controls do not close alone, and the checks to run outside the platform.

Guest and public file exposure

A file marked public or reachable through a guest-accessible route can be fetched by anyone who holds its URL, and that URL is often shared, cached or indexed. Check every attachment field and web form that accepts files, confirm which ones create public files by default, and test an unauthenticated request against a sample private file. Keep sensitive records such as payslips, bank details and contracts on private storage, and review the file list for public entries each quarter.

Extension spoofing and mismatched content

An extension allow list only checks the file name, so a script or HTML page renamed to look like a spreadsheet can pass. Browsers may render uploaded HTML or SVG inline if it is served from the site origin. Define the allowed extensions for each use case, verify the content type on the server side, and serve user uploads with download headers and a separate domain where possible. Test with a renamed executable and a file with an embedded script.

Metadata leaking location and device data

Photos from phones often carry EXIF fields such as GPS coordinates, device model and capture time. Once an image is attached to a delivery, inspection or claim, those fields travel with it to every person who can open the file. Decide which upload types must be cleaned, strip metadata before storage or in a processing step outside Frappe, and confirm that the cleaned copy is the only one users can download. Keep an original only where a retention rule requires it.

Backups and logs holding attachments

Database backups hold file records and the file system holds the bytes, so a restore brings back attachments that were deleted, restricted or should have expired. Logs and error traces can also record file names, paths and user identifiers. Ask who can read backup sets, whether they are encrypted, and how long they are kept. Test a restore into a separate environment and confirm that private files stay private after restore.

Unscanned files passed onward

Frappe stores what it receives but does not scan it for malware, so an infected file uploaded by one user can reach colleagues, print formats, email attachments or integrations that pull files automatically. Route uploads through an antivirus or sandbox service in your infrastructure before they become usable, and block or quarantine files that fail. Confirm which downstream integrations read attachments and whether they run the same check.

Attachments kept after record deletion

Deleting a document in ERPNext does not guarantee that its attached files are removed from storage or from every backup, and orphaned files can remain reachable by URL. Map which DocTypes hold personal or regulated attachments, define how long each type must be kept, and write a deletion procedure that covers the file store and backup rotation. Ask whether your data protection obligations require erasure on request and how you will evidence it.

Questions buyers ask before securing ERPNext uploads

How much work do upload controls take in ERPNext?

The work depends on how many DocTypes accept attachments, how many portals or web forms accept files from outside your staff, and whether you need malware scanning outside Frappe. Each DocType needs a decision on allowed extensions, maximum file size and whether files are public or private. Guest paths, such as web forms that accept uploads without login, add review and testing time because they expand who can send a file. A scanning integration adds design, hosting and error handling work. Ask your partner for a written list of every attachment point before estimating effort.

Can our internal team secure ERPNext uploads without a partner?

Yes, many teams can configure the core settings themselves if they have an administrator who understands Frappe and access to the server. The settings involved include allowed file types, size limits and the public or private file choice on each record type. Teams usually need outside help for the parts that are harder to verify: reviewing custom apps and scripts that handle files, designing a scanning pipeline, and testing guest paths against hostile input. Decide early which part your staff will own and which part needs an independent reviewer.

What does the upload security work need from our team?

You will need to name an access model owner who can say which roles should attach files to which records, and a business owner who can confirm which file types are legitimate for each process. Provide sample files that represent normal use, including the largest files people send today, so testing reflects real workflows. Provide test accounts for each role and for any external user group. Storage and backup owners must confirm where private and public files are kept, how long they are retained and how restores are tested.

How long does this take, and what sets the timeline?

Duration depends on scope, not on a fixed template. The main drivers are the number of attachment points, the number of external entry points, whether custom code handles files, and whether a scanning service must be built or connected. Organizations also lose time when access models are unclear or when storage ownership is not decided. Ask DeployOpen for a written scope with deliverables and a timeline before work starts, and compare the scope line by line with any internal estimate.

Does DeployOpen issue compliance certification for our file upload controls?

No. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports, attestations or certifications. Independent auditors and certification bodies perform those assessments. A useful engagement produces documented settings, test results and an explanation of how each control maps to your framework, which your auditor can then review. Confirm with your auditor which evidence they expect before the work starts.

What changes between Frappe Cloud and a self-hosted ERPNext?

On Frappe Cloud, the platform operator manages parts of the infrastructure, so your work focuses on ERPNext settings, your apps and your data policies. Self-hosting gives you control over the web server, the storage layer, the scanning service and the network path for uploads, which means you also own those controls and their patching. Frappe's supported versions policy ties warranty coverage to a listed version and a matching Frappe Cloud support plan, so check that requirement before choosing a hosting model. Server Scripts that process files are disabled by default from version 15 and are not available on Frappe Cloud public shared benches, which affects how custom checks can be built.

Will a scanning service outside Frappe fully stop malicious files?

No single control stops every malicious file. Extension checks, size limits, private storage and metadata stripping reduce exposure, and an external scanning service adds signature or behavior checks for files that pass those rules. Each layer has blind spots, so the design should state what each layer is expected to catch and what remains. Ask for a test plan that includes known-bad samples in a controlled environment, and confirm the scanner's update and error-handling process with its vendor.

Limits to confirm in your environment

Most upload controls in ERPNext depend on the version you run, the hosting model you chose and the network path in front of the site. The cards below list what to confirm before you write a file upload policy, so the settings you document match what your deployment actually enforces.

Option names and defaults

Extension lists, maximum file sizes and attachment behavior can differ between ERPNext and Frappe releases, and the defaults in a fresh install may not match an upgraded site. Check the exact System Settings and site configuration keys in your version, then record the value each site enforces. Test an upload of a blocked type and an oversized file on a staging copy before you rely on the setting.

Scanner and EXIF tool fit

Malware scanning and EXIF stripping usually run as a separate service or a hook you build, so they must fit your hosting model. Confirm whether you can run a scanner on the same host, in a sidecar container or through your storage vendor, and whether your data residency rules allow files to leave the network for scanning. Decide what happens to a file that fails or times out a scan.

Frappe Cloud code restrictions

Server Scripts can add upload validation, but they are disabled by default from version 15 and Frappe Cloud public shared benches do not allow them. If you host on Frappe Cloud, confirm which custom validation is possible on your plan, and whether a dedicated bench or a custom app is needed. On self-hosted sites, confirm the server_script_enabled setting before you design around it.

Proxy and load balancer limits

Nginx, a cloud load balancer or a Web Application Firewall may reject large request bodies before ERPNext sees them, and each layer can set its own limit. Confirm the body size limit at every hop, including any CDN, and make sure the ERPNext limit and the proxy limit agree. A mismatch can produce confusing errors for users and gaps in what your logs record.

Retention and backup of private files

Private files live in the site's file storage and are included in backups only if your backup job captures them. Confirm where attachments are stored, how long deleted files remain recoverable, and whether backups are encrypted and access controlled. Test a restore that includes an attachment, because a removed file may still exist in older backups that your policy must cover.

Vendor support status

Frappe's support policy ties warranty coverage to a listed version and a matching support plan, so an unsupported version can leave upload fixes to your own team. Check the current end-of-life dates for your major version on the supported versions page before you commit to a control design. Plan upgrades so that security patches for the upload path arrive in a version you can still receive support for.

Deciding between platform settings, custom code and outside scanning

Start with the platform settings. For most internal users, the attachment controls in ERPNext and Frappe are the right first layer: an allow list of file extensions, a maximum file size, and a clear decision on whether guests can upload at all. These controls cost nothing beyond configuration and testing, they apply to every DocType that accepts attachments, and an administrator can change them without a code release. Their limit is that they check the file name and size, not what the file actually contains. A .pdf renamed from an executable still passes an extension rule, so the settings reduce exposure without closing it. Before you rely on them, confirm the exact setting names and defaults for your version against the official documentation, and test them with a file of each type your users actually send.

Add custom validation only where your deployment allows it. Server Scripts run Python on document events, and from version 15 they are disabled by default and must be enabled with the server_script_enabled setting. Frappe Cloud public shared benches do not allow them at all, so a team on that tier cannot use this layer. A custom app gives you more control over validation, such as checking content types or stripping metadata before a file is saved, but it adds code you must review, test on every ERPNext upgrade and maintain. Its license also matters when you plan one: ERPNext is licensed under GPL-3.0, while the Frappe Framework is licensed under MIT. Ask your legal or licensing team to confirm how those terms apply to your custom app and to any code you distribute outside your organization before you commit to this path.

Add outside scanning or quarantine for guest and external intake, such as public web forms, supplier portals or customer document requests. Scanning sits outside Frappe, so it does not depend on which scripts or apps your bench permits, and it can inspect file contents with malware engines and content checks. The trade-off is operational: you add a scanning service, a quarantine location, a workflow that releases files only after they pass, and an owner for false positives. Decide up front whether an upload waits in quarantine before anyone in ERPNext can see it, because a file attached to a record is visible to users with access to that record. Scope this layer to the intake points that accept untrusted input, and keep internal-only attachments on the simpler controls unless your risk assessment says otherwise.

How DeployOpen works on this

DeployOpen scopes upload security for ERPNext as a written, fixed-scope engagement covering the Frappe settings, the infrastructure layer and the scanning you choose to add. We build and test each control in your own environment, then hand over documentation and the configuration your team needs to run it.

How we scope

  • Inventory the DocTypes and roles that accept attachments, including any guest-facing web forms
  • Record which file types, sizes and visibility levels each business process actually needs
  • Agree in writing which controls sit inside Frappe and which need external scanning or proxy rules
  • Confirm your ERPNext and Frappe versions and hosting model, such as bench, Docker or Frappe Cloud

How we build

  • Apply allowed extension and maximum file size settings per site, then test rejected uploads against each role
  • Review public and private file handling, and confirm guest upload paths are closed or justified
  • Configure EXIF stripping or external malware scanning where your scope requires it, with tested fallback behavior
  • Verify server scripts and custom apps that touch files, noting that server scripts need enabling first

How we hand over

  • Deliver a written configuration record listing each setting, its value and the reason for it
  • Provide test cases with expected results so your team can rerun them after each upgrade
  • Document the scanning pipeline, its logs, and who receives alerts when an upload is blocked
  • Walk your administrators through changes so they can review and extend the controls themselves

How we support

  • Retest upload controls after each ERPNext or Frappe minor release that touches file handling
  • Offer ongoing support and continuous testing as a retainer, priced separately from the initial scope
  • Confirm which Frappe version your site runs and whether your support plan covers it before planning changes
  • Review new custom apps or integrations against the upload policy before they reach production

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.