Skip to content

Implement unbound dns caching - #35

Open
Bandit-HaxUnit wants to merge 1 commit into
masterfrom
cursor/implement-unbound-dns-caching-23a6
Open

Implement unbound dns caching#35
Bandit-HaxUnit wants to merge 1 commit into
masterfrom
cursor/implement-unbound-dns-caching-23a6

Implement Unbound DNS caching with performance and security optimizat…

8973412
Select commit
Loading
Failed to load commit list.
This check has been archived and is scheduled for deletion. Learn more about checks retention
Cursor / Cursor BugBot completed Jul 17, 2025 in 2m 38s

BugBot Review

BugBot Analysis Progress (2m 40s elapsed)

✅ Gathered PR context (2s)
✅ Analyzed code changes (1s)
✅ Completed bug detection — 1 potential bug found (2m 35s)
✅ Validation and filtering completed (0s)
✅ Posted analysis results — 1 bug reported (1s)
✅ Analysis completed successfully (0s)

Final Result: BugBot completed review and found 1 potential issue

Request ID: serverGenReqId_16a7f85b-c133-4483-acdf-5633501f2852

Details

Bug: DNS Resolution Failure in Docker Container

The application's DNS resolution, including subdomain bruteforce, is hard-coded to use the local Unbound DNS resolver (127.0.0.1). The docker-entrypoint.sh attempts to start Unbound but proceeds even if it fails, only issuing a warning. This creates a critical dependency without fallback to external DNS servers (e.g., 8.8.8.8). Consequently, all DNS operations will fail if Unbound is unavailable, yet the container will appear to start successfully.

main.py#L581-L582

haxunit/main.py

Lines 581 to 582 in 8973412

f"{'--stats' if not self.quick else ''} "
f"-wd {self.site} -o {self.dir_path}/dnsx_result.txt -r 127.0.0.1 -stats"

main.py#L623-L624

haxunit/main.py

Lines 623 to 624 in 8973412

f"-w data/subdomains-1000.txt -wd {self.site} "
f"-o {output_file} -r 127.0.0.1"

docker-entrypoint.sh#L18-L49

# Start Unbound DNS resolver in the background
echo "Starting Unbound DNS resolver..."
if [[ -f "/app/start-unbound.sh" ]]; then
chmod +x /app/start-unbound.sh
tmux new-session -d -s unbound "/app/start-unbound.sh"
echo "Unbound DNS resolver started in background session"
# Wait a moment for Unbound to start
sleep 3
# Test if Unbound is running
if pgrep unbound > /dev/null; then
echo "Unbound is running successfully"
else
echo "Warning: Unbound may not have started properly"
fi
else
echo "Warning: Unbound startup script not found"
fi
# Start OpenVPN in the background if the configuration file is provided.
if [[ -n "$HTB_OPENVPN_FILE" && -f "$HTB_OPENVPN_FILE" ]]; then
echo "Starting OpenVPN connection in the background..."
# Ensure the command is run in a way that doesn't block the entrypoint
tmux new-session -d -s openvpn "openvpn --config ${HTB_OPENVPN_FILE}"
else
echo "VPN not started. HTB_OPENVPN_FILE is not set or file not found."
fi
# Execute the command passed to the container (e.g., ["tail", "-f", "/dev/null"])
exec "$@"

Fix in CursorFix in Web


BugBot free trial expires on July 24, 2025
Learn more in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎