Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295852

(change notice, etc.) String::format() marks a resulting string as safe even when passed an unsafe passthrough argument

$
0
0

Problem/Motivation

Issue title says it all.

Proposed resolution

Change String::format() to not call SafeMarkup::set() on the result if there are one or more passthrough arguments that are not safe.

Remaining tasks

Review. Commit.

User interface changes

None.

API changes

No change to any documented API. But code that was relying on the broken behavior will now need to ensure that passthrough arguments are safe if it wants the result to be marked safe.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue categoryBug because SafeMarkup::isSafe() is returning incorrect information.
Issue priorityMajor because incorrectly marking a string as safe can lead to security vulnerabilities. Not critical because String::format() documents that passthrough arguments must already be safe, so this bug only affects code that violates that documentation. Prior versions of Drupal were released with the same expectation that sanitizing passthrough arguments is the responsibility of the caller, so this bug is not a regression.
Prioritized changesThe main goal of this issue is security.
DisruptionOnly disruptive for modules that are passing strings not marked as safe and expecting the result to be treated as safe. There are some cases in which this is a not-insecure expectation, such as when the input string is known to be safe due to custom validation but isn't marked as such, but it isn't hard to fix such code to comply with D8 SafeMarkup rules, as is shown in the cases within the patch.

Viewing all articles
Browse latest Browse all 295852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>