Skip to content

Conversation

@remicollet
Copy link
Member

php_mt_rand_range exists since 5.6
php_rand dropped in 8.4

Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that PHP 7.2 apparently is the minimally supported version, this should just use php_random_bytes() and not fall back to insecure randomness.

@remicollet
Copy link
Member Author

and not fall back to insecure randomness.

using mcrypt is a security problem in all cases, as the library is dead for >10 years ;)

smoser added a commit to smoser/wolfi-os that referenced this pull request Nov 20, 2024
Grab php/pecl-encryption-mcrypt#19
which just uses php_mt_rand_range rather than now-removed php_rand.
smoser added a commit to smoser/wolfi-os that referenced this pull request Nov 21, 2024
Grab php/pecl-encryption-mcrypt#19
which just uses php_mt_rand_range rather than now-removed php_rand.
@L3o-pold
Copy link
Contributor

Can we see this merged @derickr ?

smoser added a commit to wolfi-dev/os that referenced this pull request Nov 21, 2024
First, just add the modules, copying from 8.3 versions.

    $ for p in php-8.3-*.yaml; do
      sed -e 's,epoch: .*,epoch: 0,' \
          -e 's,name: php-8.3-,name: php-8.4-,' \
         "$p" > php-8.4${p#php-8.3};
    done

Then fix some to build with 8.4, cherry picking from upstream.

 * php-8.4-pecl-mcrypt - cherry-pick a PR to build for 8.4
   Grab php/pecl-encryption-mcrypt#19
   which just uses php_mt_rand_range rather than now-removed php_rand.

 * php-8.4-imagick - cherry pick pr to build for 8.4
   Grab Imagick/imagick#690 
   to replace php_strlower with zend_str_tolower

 * php-8.4-xdebug - cherry pick several upstream changes
   NOTE: I have very low confidence in this, other than it builds.
   xdebug is active and likely to release a 3.4.0 release soon
   that has php 8.4 support properly.

   By adding php-8.4-xdebug with updates enabled, we will get
   a PR automatically made and hopefully landed just by dropping
   the cherry-picks here.

 * Drop php-8.4-swoole - not supported upstream yet.
    
   Several changes would be needed to make the 5.1.5
   version of swoole build with php 8.4.
   Upstream explicitly removed support from
   the 5.1 branch swoole/swoole-src#5525
   
   There is likely 6.0.0 release coming soon (beta released 2024-10-17).
   We will have to manually re-add at that point in time.

 * php-8.4-memcached and php-8.4-redis are separated out to another PR
   as they are dependent on php-8.4-igbinary output.
@rlerdorf rlerdorf mentioned this pull request Feb 20, 2025
@derickr
Copy link
Member

derickr commented Aug 5, 2025

The mcrypt extension is deprecrated, please please please upgrade your code base to something newer. A new release will be here soon.

@derickr derickr closed this Aug 5, 2025
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.

5 participants