[PR #576] Fix ssrf validation #574

Open
opened 2026-02-26 10:32:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nsupdate-info/nsupdate.info/pull/576
Author: @whitesquirrell
Created: 4/14/2025
Status: 🔄 Open

Base: masterHead: master


📝 Commits (1)

📊 Changes

1 file changed (+23 additions, -1 deletions)

View changed files

📝 src/nsupdate/main/forms.py (+23 -1)

📄 Description

Summary

This pull request addresses a potential Server-Side Request Forgery (SSRF) vulnerability in the EditDomainForm.clean() method.

Details

Currently, the form accepts arbitrary nameserver_ip inputs, which are passed to the check_domain() function. This leads to dynamic DNS update attempts to the specified IP address, including internal ones (e.g., 127.0.0.1). As a result, attackers could potentially:

  • Probe internal network services
  • Interact with unintended internal DNS servers
  • Perform SSRF attacks using the application's backend

Fix

This patch adds validation using Python’s ipaddress module to reject loopback, private, and reserved IP addresses before performing any DNS update.

Impact

This prevents misuse of the DNS update mechanism and mitigates the risk of SSRF attacks via internal IP injection.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nsupdate-info/nsupdate.info/pull/576 **Author:** [@whitesquirrell](https://github.com/whitesquirrell) **Created:** 4/14/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`d612cd5`](https://github.com/nsupdate-info/nsupdate.info/commit/d612cd5aee7a471c134c3772aa7628f97dbf6d82) Fix ssrf validation ### 📊 Changes **1 file changed** (+23 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/nsupdate/main/forms.py` (+23 -1) </details> ### 📄 Description ### Summary This pull request addresses a potential Server-Side Request Forgery (SSRF) vulnerability in the `EditDomainForm.clean()` method. ### Details Currently, the form accepts arbitrary `nameserver_ip` inputs, which are passed to the `check_domain()` function. This leads to dynamic DNS update attempts to the specified IP address, including internal ones (e.g., 127.0.0.1). As a result, attackers could potentially: - Probe internal network services - Interact with unintended internal DNS servers - Perform SSRF attacks using the application's backend ### Fix This patch adds validation using Python’s `ipaddress` module to reject loopback, private, and reserved IP addresses before performing any DNS update. ### Impact This prevents misuse of the DNS update mechanism and mitigates the risk of SSRF attacks via internal IP injection. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nsupdate.info-nsupdate-info#574
No description provided.