Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Security: fix PHP object injection in panels_data meta guards - #167

Open
zhildzik wants to merge 1 commit into
masterfrom
fix/panels-data-object-injection
Open

zhildzik wants to merge 1 commit into
masterfrom
fix/panels-data-object-injection

Conversation

@zhildzik

Copy link
Copy Markdown
Contributor

The add_post_metadata/update_post_metadata guards for panels_data called maybe_unserialize() on the incoming meta value. A Contributor could add a custom field named panels_data with a serialized object string and have it instantiated during their own request (PHP Object Injection).

  • widgetopts_protect_panels_data_meta() and widgetopts_siteorigin_protect_logic_on_save(): never unserialize request data; only inspect array values (what SiteOrigin passes). A string value is stored by core as a plain string and never read back as panels data.
  • Migration: read raw builder/widget data through safe_unserialize(), which uses allowed_classes (stdClass for Beaver Builder nodes, none otherwise) and skips values that contain any other class.

Refs WidgetOptions/extended-widget-options#43

The add_post_metadata/update_post_metadata guards for panels_data called
maybe_unserialize() on the incoming meta value. A Contributor could add a
custom field named panels_data with a serialized object string and have
it instantiated during their own request (PHP Object Injection).

- widgetopts_protect_panels_data_meta() and
  widgetopts_siteorigin_protect_logic_on_save(): never unserialize request
  data; only inspect array values (what SiteOrigin passes). A string value
  is stored by core as a plain string and never read back as panels data.
- Migration: read raw builder/widget data through safe_unserialize(), which
  uses allowed_classes (stdClass for Beaver Builder nodes, none otherwise)
  and skips values that contain any other class.

Refs WidgetOptions/extended-widget-options#43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants