Skip to content

Anomalous 'enc' parameter (value 2) passed to Libcrypto EVP_CipherInit_ex in 1.27.4 image #1050

@abwesend890

Description

@abwesend890

Bug Overview

Description:
Dynamic tracing reveals that the official Nginx docker image is passing an anomalous parameter to the OpenSSL EVP_CipherInit_ex function. The enc parameter is being set to 2.

Expected Behavior

According to the official OpenSSL manual, the enc parameter should only accept 1 (encrypt), 0 (decrypt), or -1 (leave unchanged). While OpenSSL currently tolerates this due to permissive internal checks, this is undocumented behavior and could break in future cryptographic updates.

Steps to Reproduce the Bug

Reproduction Environment:

  • Nginx Docker Tag: 1.27.4
  • Image ID: 97662d24417b

Environment Details

> uname -a
Linux x1-c 6.8.0-111-generic #111~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 14 17:13:45 UTC  x86_64 x86_64 x86_64 GNU/Linux
> docker compose version
Docker Compose version v5.1.3

Additional Context

Additional Context:
This behavior appears specifically in pre-built configurations like the Docker image mentioned above. When OpenSSL and Nginx are built manually from source, this anomalous parameter passing disappears. This suggests the issue might be tied to how the libraries are compiled or linked in the official image environment.

Could the maintainers investigate what is causing Nginx (or its included modules) to pass 2 to the cipher initialization context in this specific build?

Related Issue

openssl/openssl#31357

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions