Document Gallery Security & Risk Analysis

wordpress.org/plugins/document-gallery

This plugin generates thumbnails for documents and displays them in a gallery-like format for easy sharing.

8K active installs v5.1.1 PHP 5.6+ WP 6.1+ Updated Jun 30, 2026
attachmentsdocumentslibrarypdfword
97
A · Safe
CVEs total1
Unpatched0
Last CVEJul 10, 2026
Safety Verdict

Is Document Gallery Safe to Use in 2026?

Generally Safe

Score 97/100

Document Gallery has a strong security track record. Known vulnerabilities have been patched promptly. It's a solid choice for most WordPress installations.

1 known CVELast CVE: Jul 10, 2026Updated 1mo ago
Risk Assessment

The document-gallery plugin version 5.1.0 presents a mixed security posture. While it demonstrates some good practices, such as a high percentage of SQL queries using prepared statements and a relatively low number of file operations and external HTTP requests, there are significant concerns. A substantial portion of its attack surface, specifically 5 out of 6 entry points, lacks authentication checks. Furthermore, the presence of the `exec` function raises a red flag, as it's a powerful function that can lead to arbitrary code execution if not handled with extreme care and robust sanitization, which is not explicitly detailed in the provided signals. The taint analysis, while showing no critical or high severity flows, did find four flows with unsanitized paths, which could be a precursor to security issues, especially when combined with the unprotected entry points and dangerous functions.

Key Concerns

  • Unprotected AJAX handlers
  • Use of dangerous function (exec)
  • Taint flows with unsanitized paths
  • Low nonce checks
  • Low capability checks
  • Output escaping not fully implemented
Vulnerabilities
1 published

Document Gallery Security Vulnerabilities

CVEs by Year

1 CVE in 2026
2026
Patched Has unpatched

Severity Breakdown

High
1

1 total CVE

CVE-2026-57695high · 7.2Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Document Gallery <= 5.1.0 - Unauthenticated Stored Cross-Site Scripting

Jul 10, 2026 Patched in 5.1.1 (5d)
Version History

Document Gallery Release Timeline

v5.1.1Current
v5.1.01 CVE
v5.0.01 CVE
v4.4.41 CVE
v4.4.31 CVE
v4.4.21 CVE
v4.4.11 CVE
v4.41 CVE
v4.3.21 CVE
v4.3.11 CVE
v4.2.61 CVE
v4.2.51 CVE
v4.2.41 CVE
v4.2.31 CVE
v4.2.21 CVE
v4.2.11 CVE
v4.21 CVE
v4.1.141 CVE
v4.1.131 CVE
v4.1.121 CVE
Code Analysis
Analyzed Mar 17, 2026

Document Gallery Code Analysis

Dangerous Functions
6
Raw SQL Queries
2
5 prepared
Unescaped Output
47
51 escaped
Nonce Checks
1
Capability Checks
1
File Operations
15
External Requests
3
Bundled Libraries
0

Dangerous Functions Found

execexec( $cmd, $out, $ret );src\inc\thumbers\class-ghostscript-thumber.php:54
exec$executable = exec( 'where gswin*c.exe' );src\inc\thumbers\class-ghostscript-thumber.php:99
exec$executable = exec( 'dir /o:n/s/b "C:\Program Files\gs\*gswin*c.exe"' );src\inc\thumbers\class-ghostscript-thumber.php:106
exec$executable = exec( 'dir /o:n/s/b "C:\Program Files (x86)\gs\*gswin32c.exe"' );src\inc\thumbers\class-ghostscript-thumber.php:112
exec$executable = exec( 'which gs' );src\inc\thumbers\class-ghostscript-thumber.php:119
execexec( 'test -e /usr/bin/gs', $dummy, $ret );src\inc\thumbers\class-ghostscript-thumber.php:127

SQL Query Safety

71% prepared7 total queries

Output Escaping

52% escaped98 total outputs
Data Flows · Security
4 unsanitized

Data Flow Analysis

4 flows4 with unsanitized paths
generateGallery (src\admin\class-ajax-handler.php:45)
Source (user input) Sink (dangerous op) Sanitizer Transform Unsanitized Sanitized
Attack Surface
5 unprotected

Document Gallery Attack Surface

Entry Points6
Unprotected5

AJAX Handlers 5

authwp_ajax_dg_upload_thumbdocument-gallery.php:96
authwp_ajax_dg_generate_iconssrc\admin\class-ajax-handler.php:5
noprivwp_ajax_dg_generate_iconssrc\admin\class-ajax-handler.php:6
authwp_ajax_dg_generate_gallerysrc\admin\class-ajax-handler.php:8
noprivwp_ajax_dg_generate_gallerysrc\admin\class-ajax-handler.php:9

Shortcodes 1

[dg] document-gallery.php:153
WordPress Hooks 24
actionadmin_noticesdocument-gallery.php:23
actionwpmu_new_blogdocument-gallery.php:57
actioninitdocument-gallery.php:62
actionplugins_loadeddocument-gallery.php:65
actiondelete_attachmentdocument-gallery.php:78
filterplugin_row_metadocument-gallery.php:89
actionadmin_menudocument-gallery.php:92
actionadd_meta_boxesdocument-gallery.php:95
actionadmin_initdocument-gallery.php:99
actionwp_enqueue_scriptsdocument-gallery.php:104
actionwp_print_scriptsdocument-gallery.php:106
actionwp_enqueue_scriptsdocument-gallery.php:108
actioninitdocument-gallery.php:124
actionenqueue_block_editor_assetsdocument-gallery.php:139
actionadmin_enqueue_scriptssrc\admin\class-admin.php:107
actionadmin_print_footer_scriptssrc\admin\class-admin.php:125
filtermce_external_pluginssrc\admin\class-admin.php:145
filtermce_csssrc\admin\class-admin.php:146
actionadmin_enqueue_scriptssrc\admin\class-admin.php:403
actionwp_prepare_attachment_for_jssrc\admin\class-ajax-handler.php:11
actionadmin_print_footer_scriptssrc\admin\class-feature-pointers.php:26
actiondg_thumberssrc\inc\thumbers\class-abstract-thumber.php:27
filterallowed_http_originsrc\inc\thumbers\class-thumber-co-thumber.php:7
filterupload_mimessrc\inc\thumbers\class-thumber-co-thumber.php:8
Maintenance & Trust

Document Gallery Maintenance & Trust

Maintenance Signals

WordPress version tested6.9.5
Last updatedJun 30, 2026
PHP min version5.6
Downloads328K

Community Trust

Rating96/100
Number of ratings112
Active installs8K
Developer Profile

Document Gallery Developer Profile

Dan Rossiter

3 plugins · 8K total installs

92
trust score
Avg Security Score
89/100
Avg Patch Time
5 days
View full developer profile
Detection Fingerprints

How We Detect Document Gallery

Patterns used to identify this plugin on WordPress sites during automated security audits and web crawling.

Asset Fingerprints

Asset Paths
/wp-content/plugins/document-gallery/build/block.js/wp-content/plugins/document-gallery/src/css/document-gallery.css
Script Paths
/wp-content/plugins/document-gallery/build/block.js
Version Parameters
document-gallery/build/block.js?ver=document-gallery/src/css/document-gallery.css?ver=

HTML / DOM Fingerprints

HTML Comments
<!-- Document Gallery Count: -->
Data Attributes
data-dg-typedata-dg-post-iddata-dg-post-typedata-dg-post-mime-typedata-dg-post-urldata-dg-attachment-id+4 more
JS Globals
dgBlockConfig
Shortcode Output
[dg]
FAQ

Frequently Asked Questions about Document Gallery