• Resolved BlogAid

    (@blogaid)


    I’ve used this plugin for years and now getting an “unknown error” when trying to export.

    Dug into it and found that it is triggering a ModSecurity error at the host that thinks it is a PHP injection attack.

    Below is the ModSecurity log from the host server:
    Message: Access denied with code 403 (phase 2). Test ‘REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/*’ against ‘@rx (?:<\?(?!xml\s)|<\?php|\[(?:/|\\\\)?php\])’ is true. [file “/etc/apache2/conf.d/modsec_vendor_configs/OWASP3/rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf”] [line “41”] [id “933100”] [msg “PHP Injection Attack: PHP Open Tag Found”] [logdata “Matched Data: <? found within filter_rules_hierarhy=[]&taxonomy_to_export=&export_only_modified_stuff=0&export_only_new_stuff=0&sub_post_type_to_export=&selected_post_type=post&export_type=specific&ids[]=1&cc_label[]=date&cc_php[]=0&cc_code[]=&cc_sql[]=0&cc_options[]=0&cc_type[]=date&cc_value[]=date&cc_name[]=date&cc_settings[]=0&ids[]=1&cc_label[]=title&cc_php[]=0&cc_code[]=&cc_sql[]=0&cc_options[]=0&cc_type[]=title&cc_value[]=title&cc_name[]=title&cc_settings[]=0&ids[]=1&cc_label[]=permalink&cc_php[]=0&cc…”] [severity “CRITICAL”] [tag “application-multi”] [tag “language-php”] [tag “platform-multi”] [tag “attack-injection-php”] [tag “OWASP_CRS/WEB_ATTACK/PHP_INJECTION”] [tag “OWASP_TOP_10/A1”] [MatchedString “filter_rules_hierarhy=[]&taxonomy_to_export=&export_only_modified_stuff=0&export_only_new_stuff=0&sub_post_type_to_export=&selected_post_type=post&export_type=specific&ids[]=1&cc_label[]=date&cc_php[]=0&cc_code[]=&cc_sql[]=0&cc_options[]=0&cc_type[]=date&cc_value[]=date&cc_name[]=date&cc_settings[]=0&ids[]=1&cc_label[]=title&cc_php[]=0&cc_code[]=&cc_sql[]=0&cc_options[]=0&cc_type[]=title&cc_value[]=title&cc_name[]=title&cc_settings[]=0&ids[]=1&cc_label[]=permalink&cc_php[]=0&cc_code[]=&cc_sql[]=0&cc_options[]=0&cc_type[]=permalink&cc_value[]=permalink&cc_name[]=permalink&cc_settings[]=0&ids[]=1&cc_label[]=url&cc_php[]=0&cc_code[]=0&cc_sql[]=0&cc_options[]={“is_export_featured”:true,”is_export_attached”:true,”image_separator”:”|”}&cc_type[]=image_url&cc_value[]=url&cc_name[]=image url&cc_settings[]=&ids[]=1&cc_label[]=category&cc_php[]=0&cc_code[]=&cc_sql[]=0&cc_options[]=0&cc_type[]=cats&cc_value[]=category&cc_name[]=categories&cc_settings[]=0&ids[]=1&cc_label[]=&cc_php[]=0&cc_code[]=&cc_sql[]=0&cc_type[]=&cc_options[]=0&cc_value[]=&cc_name[]=&cc_settings[]=0&export_variations=1&export_variations_title=1&main_xml_tag=data&record_xml_tag=post&custom_xml_cdata_logic=auto&show_cdata_in_preview=0&simple_custom_xml_cdata_logic=auto&delimiter=,&export_to=csv&export_to_sheet=csv&xml_template_type=simple&8=producttitle&12=productdescription&19=productlink&23=useproductfeaturedimage&29=productimages&38=useproductprice&44=useproductsaleprice&50=usewoocommercestockvalues&60=usewoocommerceproductcategories&64=mapproductcategories&78=1&85=automatically&89=selectfromwoocommerceproductattributes&95=selectfromwoocommerceproductattributes&101=selectfromwoocommerceproductattributes&107=keepblank&118=selectfromwoocommerceproductattributes&127=selectfromwoocommerceproductattributes&135=selectfromwoocommerceproductattributes&include_shipping=include&148=usewoocommerceproductvalues&152=&160=no&custom_xml_template=<?xml version=”1.0″ encoding=”utf-8″?>..<data>…<!– begin loop –>…<post>…..</post>…<!– end loop –>..</data>&custom_custom_xml_cdata_logic=auto&wp_all_export_main_code=<?php….?>&save_template_as=0&name=&load_template=&_wpnonce_template=b3790d5cc9&_wp_http_referer=/wp-admin/admin.php?page=pmxe-admin-export&action=template&_wpnonce_template=b3790d5cc9&is_submitted=1″]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @blogaid,

    Based on the logs, this is a false positive due to the opening and closing PHP tags inside the export data. I’ve reported it to our developers so that we can make changes to avoid triggering this in the future, but for now I’d suggest asking your host if they can whitelist WP All Export.

    Thread Starter BlogAid

    (@blogaid)

    Thank you for checking into this. Two conditions had to be met to get it to run – IP whitelisted at Cloudflare and turning off ModSecurity at the host, as it triggered both of their OWASP settings.

    Many hosts have turned off so many rules in ModSecurity that it is practically worthless for security now. But the host me and my clients are on has pretty strict security, which we like.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ModSecurity tripped with unknown error on export’ is closed to new replies.