Summary
phpIPAM through 1.8.1 does not sufficiently verify that an address requested through a temporary subnet share belongs to the subnet authorized by that share. An unauthenticated person with any valid, non-expired temporary share URL may access IP address records from other subnets and sections by manipulating the referenced identifier.
Affected context
The issue occurs in phpIPAM temporary shares when the share type is subnets and request-controlled subnet identifiers are used to retrieve address records. Deployments are at risk when temporary share URLs are accessible to untrusted parties and authorization checks do not bind each requested address to the subnet associated with the issued share.
Exploit preconditions
- Attack surface: Temporary share endpoints in
app/temp_share/index.phpandapp/temp_share/address.php - Required access: A valid, non-expired temporary share URL; authentication to phpIPAM is not otherwise required
- Trigger point: Retrieval of an address record through a temporary subnet share
- Authorization condition: The application must accept a user-controlled subnet identifier without confirming that it belongs to the share's authorized subnet
- Why exploitation is possible: Object lookup is performed using the supplied identifier while the requested record is not adequately constrained by the share's authorization scope
Why this happens
The underlying bug is an authorization failure involving a user-controlled database key. The application treats the subnetId parameter as sufficient to select an address record instead of enforcing an object-level relationship between that record, its subnet, and the temporary share.
This maps to CWE-639: Authorization Bypass Through User-Controlled Key, a form of insecure direct object reference in which changing an identifier can expose objects outside the caller's permitted scope. The insecure pattern is trusting a request identifier without performing an independent, server-side authorization check.
Potential impact
- Unauthorized parties may read IP address records across sections and subnets.
- Hostnames, DNS names, MAC addresses, and owner or contact fields could be disclosed.
- Notes may expose credentials, network configuration, or other sensitive operational details.
- Attackers could use exposed inventory data to support reconnaissance or later attacks.
- Privacy, confidentiality, and network-segmentation expectations may be weakened.
General mitigation guidance
Mitigation generally focuses on enforcing object-level authorization at the point where each address record is retrieved.
Common defensive patterns include:
- Binding every requested address and subnet to the scope represented by the temporary share token.
- Performing server-side authorization checks independently of user-controlled identifiers.
- Avoiding direct object lookups that rely solely on request parameters.
- Returning a uniform not-found or unauthorized response when an object is outside the share scope.
- Limiting temporary share lifetime, exposure, and accessible fields according to least privilege.
- Treating notes and contact fields as potentially sensitive and minimizing their disclosure through public shares.
- Applying defense-in-depth controls such as monitoring, rate limiting, and restrictive database access.
How teams detect issues like this
Organizations can look for this weakness through:
- Static analysis rules identifying database queries driven directly by request parameters without adjacent authorization checks.
- Code review signals such as primary-key lookups that do not include tenant, subnet, token-scope, or ownership constraints.
- Tests that verify temporary-share access remains restricted when object identifiers refer to unrelated sections or subnets.
- Audit-log monitoring for repeated access to sequential or unusual subnet and address identifiers.
- Policy enforcement requiring object-level authorization checks for every externally addressable record.
- Automated security testing and code-review tools that flag insecure direct object reference patterns.

