beefproject / beefproject/beef

Review "IP address has changed" functionality

Open
#2,821 1 comment 0 reactions 0 assignees View on GitHub
Defect Low
Dominant language
JavaScript
Stars
11k
Forks
2.4k
Avg merge
1d 1h
Merged PRs (30d)
15

Description

The "IP address has changed" functionality is dodgy. Worse, when `allow_reverse_proxy` is used, the `X-Forwarded-For` header is trusted implicitly without validation.

https://github.com/beefproject/beef/blob/943a6fd2266f2652e64885c499e8f8fb5735ac10/core/main/handlers/hookedbrowsers.rb#L93-L102

Here's an example someone provided, showing that the stored IP address contains two IP addresses separated by `,`.

![image](https://user-images.githubusercontent.com/434827/232200214-a2abffbb-0f19-4b0d-806a-1f846f73fd02.png)

It may also result in many "IP address has changed" events in load balanced environments. Although I'm not sure that this is avoidable.

Contributor guide

Open the contributing guide

Research direction

Start with core/main/handlers/hookedbrowsers.rb lines 93-102 and trace the "IP address has changed" handling, especially the allow_reverse_proxy path and X-Forwarded-For input. Compare the reported comma-separated address and load-balanced behavior, then define validation and completion criteria before making a change.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.