skip to content

After an explicit FTPS client sends CCC, what remains protected, what returns to clear text, and what risk does that accept?

level: seniorimportance: nice to knowfreq 9%

answer

  1. clear the command channel
  2. TLS shut, TCP kept
  3. PROT setting frozen
  4. names and commands readable again
  5. injection the server cannot detect

basics

~20 s

CCC shuts TLS on the FTPS control connection, usually after login. Credentials already sent stay protected and data keeps its PROT P setting, but later commands and replies, file names included, cross in clear and can be altered on the path.

solid answer

~50 s

`CCC` (Clear Command Channel, RFC 2228, profiled for TLS in RFC 4217) asks the server to drop TLS on the control connection. An accepting server replies `200 Command okay.`, shuts down the TLS session but keeps the TCP connection, continues in plain text and accepts **no further `PBSZ` or `PROT`**: every later transfer keeps the protection already set, so `PROT P` data stays encrypted. What was sent after `AUTH TLS` and before `CCC` (`USER`, `PASS`, `PBSZ`, `PROT`) stayed inside TLS. What is given up is the control channel's confidentiality and integrity for the rest of the session: file names, paths and data-connection setup become readable, and RFC 2228 warns that unprotected commands let an attacker insert commands the server cannot recognise as forged. RFC 2228 calls `CCC` not recommended, and servers may refuse it with `534`.

go deeper

for a junior

Remember that CCC means Clear Command Channel: it turns TLS off on FTPS commands, not on files.

for a middle

Explain RFC 4217's behaviour: 200, TLS shut but TCP kept, no further PBSZ or PROT, PROT P data still encrypted.

for a senior

Show that the real cost is command integrity, prefer a passive port range over CCC, and refuse CCC before login or without PROT P.

for a principal

Decide whether a firewall's need to read FTP commands justifies losing command integrity, or whether the estate should move to a protocol that needs no helper.

## What CCC does **CCC** (Clear Command Channel) is an FTP security extension from RFC 2228 that RFC 4217 profiles for TLS. It lets a session protect the sensitive opening (the TLS upgrade and the login) and then return the **control connection** to plain text. The usual reason is that firewalls and NAT devices want to read the control connection; why they do is covered with FTP's NAT and firewall problems. This answer is about what the session gives up. RFC 4217 section 5 says a server that accepts `CCC` should: 1. Send `200 Command okay.` 2. Shut down the TLS session on the socket, leaving the TCP connection open. 3. Continue the control connection in plain text, expecting the next command unencrypted. 4. Accept no more `PBSZ` or `PROT` commands; all later data transfers use the current `PROT` setting. A typical sequence is therefore `AUTH TLS` (`234`), `PBSZ 0`, `PROT P`, `USER`/`PASS`, then `CCC`. Ordering matters: once `CCC` is accepted, `PROT P` can no longer be set. ## Reply codes | Reply | Meaning under RFC 4217 | |---|---| | `200 Command okay.` | Accepted; the control connection is now clear text | | `500 Syntax error, command unrecognized.` | The server does not accept or understand `CCC` | | `533` | The control connection is not protected with TLS, so there is nothing to clear | | `534 Request denied for policy reasons.` | The server will not clear the control connection at this time | ## What stays protected and what does not | Item | Before CCC | After CCC | |---|---|---| | `USER` and `PASS` already sent | inside TLS | still never exposed | | Data connections with `PROT P` | TLS | TLS, unchanged | | Later commands (`STOR`, `RETR`, `DELE` and the rest) | inside TLS | clear text | | File names, paths, directory changes | hidden | readable | | Data-connection setup (`PASV`, `PORT`, their replies) | hidden | readable | | Server replies | inside TLS | clear text | | Ability to change `PROT` | yes | no | ## The integrity cost Readable file names are the visible loss; the larger one is **integrity**. RFC 2228 explains that if unprotected commands are allowed, an attacker on the path can **insert a command on the control stream and the server has no way to know it is not genuine**. After `CCC`, an attacker who can modify traffic could: - inject a delete or rename command for files the logged-in user is allowed to change; - alter the arguments of a transfer, so a different file is fetched or stored; - tamper with replies the client relies on, confusing automation that parses them. The data itself stays protected by `PROT P`, but the commands that decide which data moves are no longer protected. That is why RFC 2228 says outright that the use of `CCC` is **not recommended** and exists for interoperability. ## Other cautions from the RFCs - **Clients should not assume `CCC` will be accepted.** Servers may refuse it by policy (`534`). - **Refuse it before authentication.** RFC 4217 notes a server may refuse `CCC` until the client has authenticated, because anonymous clients could otherwise loop `AUTH TLS` then `CCC` to tie up server resources with handshakes. - **Not a downgrade of data.** `CCC` does not turn `PROT P` off; anyone claiming it "drops FTPS" has confused the two connections. ## When it is accepted and what to prefer Teams reach for `CCC` when a firewall's FTP helper must see the control channel to open data connections. Before allowing it: 1. Prefer opening a **fixed passive port range** on the firewall and keeping the control channel encrypted for the whole session. 2. If clients can move, prefer a protocol that needs no helper at all. 3. If `CCC` must be allowed, restrict it to paths where on-path tampering is not a realistic threat, require `PROT P` before it, and refuse it to unauthenticated sessions. 4. Record it as an accepted risk: integrity of commands after login is gone. In a security review, a server that permits `CCC` is a finding worth explaining, not an automatic failure; a server that permits it before login, or without `PROT P` already set, is the stronger finding.

  • Can an FTPS client switch its data protection back to PROT C after the server accepts CCC?
    No. RFC 4217 says a server that accepts `CCC` takes no more `PBSZ` or `PROT` commands, and every later transfer uses the `PROT` setting in force at that moment. That is why a client sends `PBSZ 0` and `PROT P` before `CCC`: once the control channel is clear, the data protection level is fixed for the rest of the session.
  • Why might an FTPS server refuse CCC until the client has logged in?
    RFC 4217 notes that anonymous clients could repeatedly send `AUTH TLS` and then `CCC` to tie up server resources with TLS handshakes. Requiring some form of client authentication first, a TLS client certificate or a completed `USER`/`PASS` login, closes that loop; the server refuses with `534` until then.

  • CCC turns encryption on for the control channel
  • After CCC the data connections also drop to clear text
  • With the password sent under TLS, a clear channel is harmless
  • CCC switches an implicit FTPS session to explicit mode
  • A server accepts CCC with 234, like AUTH TLS