As its README states, devel is designed to be safe for Production use, should its operator desire that and be capable enough to understand the risks.

In this maintainer's opinion, and in the opinion of the Drupal Security Team, devel's Execute PHP form is a bit too risky, even for knowledgeable users. As such, we plan to remove this feature. Users who miss it are encouraged to use and improve the PHP module.

As its README states, devel is designed to be safe for Production use

Finally, while the README does state that, it seems kind of weird to me. I have rarely seen a need to run it in production, and indeed almost all Composer-based builds nowadays add it as a dev dependency (so it's not even available to install on production)... Not quite sure what the value would be of encouraging it to be available in a production codebase.

But that's neither here nor there, since that's my subjective opinion (namely, "development tools shouldn't exist in production")—my main sticking point is this is a major feature removal in the 1.x branch, and even though Drupal.org modules don't follow strict semantic versioning, anyone updating the module in the 1.x branch who uses this handy tool will get a nasty surprise.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman created an issue. See original summary.

moshe weitzman’s picture

Issue summary: View changes
kala4ek’s picture

Why does anyone need to use the Devel module at PRODUCTION?

devel is designed to be safe for Production use

Devel does not need at production at all.

If this issue will be done, so... it's fork time :)
Glad that anyone can publish a new module, like Better Devel

mikhailkrainiuk’s picture

Status: Active » Needs review

Hello!

Yes, this module is nice to development. But we disable it on production websites in most cases.

I created the patch to README to fix it :)
Verify it, please.
Thank you!

mikhailkrainiuk’s picture

kala4ek’s picture

Status: Needs review » Reviewed & tested by the community

+1 Really useful patch.

lussoluca’s picture

Maybe we can move the Execute PHP feature to a new Devel's submodule?
In this way users can install Devel in production without any risk and we can put a security alert only if Execute PHP submodule is enabled.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Active

The README patch is rejected.

Moving Execute PHP to a submodule helps minimize the risk, but it doesn't minimize enough. I want this project to keep its Security Team coverage, and we can't do so with this feature, even in a submodule.

Please consider using and improving PHP module (or make your own). Thats the module that carried on Drupal core's arbitrary PHP runner, once that feature was removed for security reasons in D8.

salvis’s picture

Link newly closed Execute PHP issues that may want to come along to a new home...

@moshe weitzman: What's the plan for D7?

lussoluca’s picture

Status: Active » Needs review
FileSize
4.84 KB

This patch removes the execute php feature from Devel.
Meanwhile I'm committing a new module: devel_php that re-adds this functionality outside of Devel

Status: Needs review » Needs work

The last submitted patch, 10: devel-remove-execute-php-3005475-9-8.patch, failed testing. View results

lussoluca’s picture

Status: Needs work » Needs review
FileSize
5.36 KB

Status: Needs review » Needs work

The last submitted patch, 12: devel-remove-execute-php-3005475-12-8.patch, failed testing. View results

lussoluca’s picture

Status: Needs work » Needs review
FileSize
5.62 KB
lussoluca’s picture

Test are passing and here there is the new module: https://www.drupal.org/project/devel_php

  • lussoluca committed 7eb4b0c on 8.x-1.x
    Issue #3005475 by lussoluca: Remove Execute PHP feature
    
lussoluca’s picture

Status: Needs review » Fixed

Committed to 8.x-1.x

willzyx’s picture

Status: Fixed » Needs work

@luca @moshe while I totally agree with the IS and the php execution code removal, I think that this changes, since are a BC break, should not be committed in the 8.1.x branch and released in a minor/patch version.
There are modules that rely on this feature and a simple update to the next minor devel release is going to break their functionalities

https://www.drupal.org/project/devel_ace
https://www.drupal.org/project/devel_clipboard
https://www.drupal.org/project/devel_snippet
https://www.drupal.org/project/devel_codemirror
https://www.drupal.org/project/admin_toolbar (#3009193: Error because devel module has removed the execute php feature)
...
(I made a very quick search but I suspect that the number of modules is definitely greater)

IMO this commit should be reverted for 8.1.x and should be handled in a 8.2.x branch

Update:
Add devel_codemirror, admin_toolbar

salvis’s picture

@willzyx: None of the three modules that you mention has a release version, and all three report only single-digit usage counts. The effort of branching far outweighs the inconvenience of having to update those modules IMO.

willzyx’s picture

@salvis

None of the three modules that you mention has a release version, and all three report only single-digit usage counts.

This changes very little in what I'm saying. The reason for which we use a simil-semver model here and in drupal core is exactly for avoid this disruptive situations.

Also note that: I made a very quick search but I suspect that the number of modules, that implicitly or explicitly, rely on this feature is definitely greater

IMHO create a new branch, even is more costly in term of effort, is the right way to go.
(And we also consider that in the issues queue there is more than an issue that is waiting for a new branch for being commited)

joachim’s picture

> I think that this changes, since are a BC break, should not be committed in the 8.1.x branch and released in a minor/patch version.

This change has broken the Admin Toolbar module, which expects to find the exec PHP route.

bojanz’s picture

So, one of Devel's main features will be removed in a point release?
Can't say I find that to be wise.

czigor’s picture

devel/php is pretty much 95% of what I use this module for. Why did it suddenly become a problem?

klausi’s picture

Agreed on the BC break. Please create a 2.x branch for devel and revert this change on the 1.x branch. Then mark the 1.x branch unsupported because the security team does not allow support.

rp7’s picture

Since this functionality is part of my "toolchain", I'm currently (until this hopefully gets fixed) adding devel to my projects as such:

composer require drupal/devel:1.x-dev#86e3b8f40c6fc8a452098b975bc9d88eeb56d774

Chris Charlton’s picture

Thank you, @rp7 (#25) for the suggested composer command that lets us update all-but-up-to-that-one-removal-of-exec-php. :D

geerlingguy’s picture

Issue summary: View changes

I kind of have to agree with:

So, one of Devel's main features will be removed in a point release?
Can't say I find that to be wise.

I quite often drop a few lines of code from a module I'm testing into a plain local D8 site's devel/php textbox to make sure they function without fully testing the code yet...

I had no idea that (which is probably one of the 3 features I use 99% of the time I use the Devel module at all) would be considered insignificant enough to be dropped in a non-major release.

I would strongly advise doing that in a 2.x, and leaving 1.x with 'unsupported' so people know they should upgrade, making sure the https://www.drupal.org/project/devel_php is mentioned in the release notes.

geerlingguy’s picture

Issue summary: View changes

(Plus it breaks Admin Toolbar locally, which I use on pretty much all my sites.)

Fixing the issue summary, oops!

drunken monkey’s picture

+1 for keeping the feature in an (unsupported) 1.x branch and only removing in a new 2.x branch.
Breaking Admin Toolbar should really be enough of a reason (certainly doesn’t fall under “single-digit usage counts”).

Chris Charlton’s picture

The 1.x vs 2.x split is logical, and a common pattern in Drupal-land. There would be no confusion having that be documented at the top of the 2.x release notes & project page summary.

  • lussoluca committed 396490c on 8.x-1.x
    Revert "Issue #3005475 by lussoluca: Remove Execute PHP feature"
    
    This...
lussoluca’s picture

Sorry for the delay.
I've reverted the commit on 8.x-1.x branch and created a new 8.x-2.x branch.
Now @moshe, we can release 8.x-1.3 (and mark it as insecure) and 8.x-2.0 that doesn't contain the PHP execution feature.

lussoluca’s picture

Status: Needs work » Fixed
temkin’s picture

Would be helpful to add a note in 2.0 release notes that it breaks Admin toolbar module. It's one of the most popular modules out there, so Devel upgrade to version 2.0 will break a lot of sites.

moshe weitzman’s picture

I think it breaks older vesions of Admin Toolbar, not the current one. We could put in a conflict statement in composer.json and also a statement in the info.yml to prevent problems.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.