glsec

Rules / GL040

GL040 Script downloads over plain FTP

Severity: warn
OWASP: CICD-SEC-6 – Insufficient Credential Hygiene

What glsec checks

glsec flags script lines that contain an ftp:// URL. Plain FTP transmits both credentials (--ftp-user, --ftp-password, or userinfo in the URL) and file contents in cleartext. Any network observer between the runner and the server can capture passwords and downloaded files.

Not flagged:

Trigger example

deploy:
  script:
    - wget --ftp-user="$FTP_USER" --ftp-password="$FTP_PASSWORD" ftp://ftp.example.com/assets.zip

Safe alternatives

Instead of Use
ftp:// ftps:// (FTP over TLS)
ftp:// sftp:// (SSH-based)
ftp:// https:// if the server supports it
curl ftp:// curl --ssl-reqd ftp:// (explicit TLS)
deploy:
  script:
    - wget ftps://ftp.example.com/assets.zip
    # or
    - curl --ssl-reqd -u "$FTP_USER:$FTP_PASSWORD" ftp://ftp.example.com/assets.zip

References

See also

Enable the ShellCheck integration to surface additional shell issues in these script blocks.

Documentation for glsec 1.23.0. Source of this page · Rule implementation