Information disclosure from HTTP URL in Ansible get_url task

High Risk infrastructure-security

What it is

Information disclosure could let attackers read or modify files, inject malware, or capture credentials via man-in-the-middle on unencrypted HTTP.

Why it happens

Using http:// URLs in get_url tasks to download packages or files, allowing MITM attacks.

Root causes

HTTP Package Downloads

Using http:// URLs in get_url tasks to download packages or files, allowing MITM attacks.

Mirror Availability Issues

Falling back to HTTP mirrors when HTTPS mirrors are unavailable instead of failing safely.

Performance Misconceptions

Believing HTTP is significantly faster than HTTPS for downloads without measuring actual impact.

Fixes

1

Use HTTPS Sources

Update all get_url tasks to use https:// URLs for downloading files and packages.

2

Verify Checksums

Always specify checksum parameters (checksum: sha256:...) to detect tampering even if using HTTP.

3

Enable Certificate Validation

Keep validate_certs: true (default) to ensure downloaded content comes from trusted sources.

Detect This Vulnerability in Your Code

Sourcery automatically identifies information disclosure from http url in ansible get_url task and many other security issues in your codebase.