HIGH poodle attackadonisjs

Poodle Attack in Adonisjs

How the POODLE Attack Manifests in AdonisJS Applications

The POODLE (Padding Oracle On Downgraded Legacy Encryption) attack exploits the fallback to SSL 3.0 and the use of weak CBC‑mode ciphers. When an AdonisJS service is exposed over HTTPS and the underlying Node.js TLS server is configured to allow SSL v3 or weak cipher suites, an attacker can force a protocol downgrade and then manipulate padding bytes to decrypt secret data such as session cookies or Authorization headers.

In a typical AdonisJS project the HTTP server is bootstrapped from start/kernel.ts. If developers create a custom HTTPS server (for example to terminate TLS at the Node layer) and mistakenly pass insecure options, the vulnerability appears directly in the code path that AdonisJS uses to handle requests.

// start/kernel.ts
import { HttpContract } from '@ioc:Adonis/Core/Http'
import { createSecureServer } from 'https'
import { readFileSync } from 'fs'

// ❌ Vulnerable configuration – enables SSLv3 and weak ciphers
const httpsOptions = {
  key: readFileSync('/etc/ssl/private/server.key'),
  cert: readFileSync('/etc/ssl/certs/server.crt'),
  // Downgrade to SSLv3 (POODLE‑prone)
  secureProtocol: 'SSLv3_method',
  // Allow only SSLv3 CBC ciphers
  ciphers: 'SSLv3'
}

const server = createSecureServer(httpsOptions, (req, res) => {
  // AdonisJS handles the request via its Http contract
  HttpContract.handle(req, res)
})

server.listen(443, () => {
  console.log('AdonisJS HTTPS server listening on port 443')
})

When the server runs with the above options, an attacker can initiate a connection, force SSLv3, and execute the POODLE padding oracle to recover up to 16 bytes of plaintext per request. Because AdonisJS does not add any TLS‑specific middleware, the flaw resides entirely in the Node TLS layer that the framework inherits.

AdonisJS‑Specific Detection – Finding POODLE with middleBrick

Detecting POODLE in an AdonisJS deployment does not require source‑code inspection; it is a network‑level TLS misconfiguration. middleBrick’s Encryption check (one of the 12 parallel scans) actively probes the target endpoint for SSLv3 support and weak CBC ciphers. If the scanner receives a successful SSLv3 handshake, it flags the finding with a severity of high and provides remediation guidance.

You can run the check from the terminal using the middleBrick CLI, which works against any URL—including those served by an AdonisJS app.

# Scan an AdonisJS API hosted at https://api.example.com
middlebrick scan https://api.example.com

The output will include a section similar to:


Encryption
----------
• SSLv3 protocol enabled (POODLE vulnerable)
  Severity: High
  Remediation: Disable SSLv3 and restrict ciphers to TLSv1.2+ suites.
• Weak CBC ciphers accepted (e.g., DES-CBC3-SHA)
  Severity: Medium
  Remediation: Use strong AEAD ciphers such as TLS_AES_256_GCM_SHA384.

Because middleBrick performs the scan unauthenticated and in 5‑15 seconds, you can integrate it into your CI pipeline (GitHub Action) to block merges that reintroduce SSLv3 or weak ciphers in your AdonisJS services.

AdonisJS‑Specific Remediation – Fixing POODLE in the Framework

The fix is to remove SSLv3 from the TLS configuration and enforce strong, modern cipher suites. In AdonisJS you have two practical approaches:

  1. Set Node’s default TLS limits early in the bootstrap process (before the HTTP server is created).
  2. When you must create a custom HTTPS server, pass secure options that explicitly disable SSLv3 and weak ciphers.

Below is an example of the first approach, placed in start/kernel.ts before importing the AdonisJS application.

// start/kernel.ts
// Enforce TLS 1.2 as the minimum version and disable SSLv3/SSLv2
process.env.NODE_OPTIONS = (process.env.NODE_OPTIONS || '') + ' --tls-min-v1.2'

// Optional: restrict to strong ciphers via the Node.js TLS API
import tls from 'tls'
tls.DEFAULT_MIN_VERSION = 'TLSv1_2'
tls.DEFAULT_MAX_VERSION = 'TLSv1_3'
tls.DEFAULT_CIPHERS = 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256'

// Now bootstrap the AdonisJS HTTP server (no custom TLS needed)
import { Ignitor } from '@adonisjs/core/build/standalone'
new Ignitor(__dirname).httpServer().start()

If you prefer to keep a custom HTTPS server (for example to terminate TLS at the Node layer while still using AdonisJS for request handling), replace the insecure options with the following:

// start/kernel.ts – secure custom HTTPS server
import { HttpContract } from '@ioc:Adonis/Core/Http'
import { createSecureServer } from 'https'
import { readFileSync } from 'fs'

const httpsOptions = {
  key: readFileSync('/etc/ssl/private/server.key'),
  cert: readFileSync('/etc/ssl/certs/server.crt'),
  // ✅ Disable SSLv3, allow only TLS 1.2 and 1.3
  secureProtocol: 'TLSv1_2_method',
  // ✅ Strong AEAD ciphers only
  ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256'
}

const server = createSecureServer(httpsOptions, (req, res) => {
  HttpContract.handle(req, res)
})

server.listen(443, () => {
  console.log('AdonisJS HTTPS server listening on port 443 (TLS 1.2+)')
})

After applying either fix, re‑run middlebrick scan. The Encryption check will now report SSLv3 disabled and Strong ciphers only, yielding a higher security grade (A‑B) for your AdonisJS API.

Frequently Asked Questions

Does middleBrick need any agents or credentials to test an AdonisJS API for POODLE?
No. middleBrick performs an unauthenticated, black‑box scan by simply submitting the public URL of your AdonisJS service. It tests the TLS handshake directly, so no agents, API keys, or server‑side access are required.
If I fix the TLS configuration in my AdonisJS app, will middleBrick automatically reflect the improved score in subsequent scans?
Yes. Each scan is independent; after you redeploy the corrected TLS settings, a new middleBrick scan will show the updated Encryption findings and a higher letter grade (A‑F) reflecting the reduced risk.