mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-03-02 22:57:00 -05:00
axios parsed IPv6 as hostname (through proxy) #2463
Labels
No labels
A:accessibility
A:api
A:cert-expiry
A:core
A:dashboard
A:deployment
A:documentation
A:domain expiry
A:incidents
A:maintenance
A:metrics
A:monitor
A:notifications
A:reports
A:settings
A:status-page
A:ui/ux
A:user-management
Stale
ai-slop
blocked
blocked-upstream
bug
cannot-reproduce
dependencies
discussion
duplicate
feature-request
feature-request
good first issue
hacktoberfest
help
help wanted
house keeping
invalid
invalid-format
invalid-format
question
releaseblocker 🚨
security
spam
type:enhance-existing
type:new
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/uptime-kuma#2463
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SkwalExe on GitHub (Aug 11, 2023).
⚠️ Please verify that this bug has NOT been raised before.
🛡️ Security Policy
Description
I have an HTTP monitor that must use IPv6 only, to do that, I set the URL directly to the IPv6 address, disable redirects, and configure the hostname manually inside the custom HTTP Headers field.
I configured a proxy. The requests are failing, due to a bug in Uptime Kuma.
I know that there is a bug by looking at the proxy's logs.
We can see the request going to
2a01:443, which is incorrect.The correct output should be
[2a01:e0a:c99:6170:907b:a8ff:fe6c:4f3b]:443I took a quick look at the code and the problem seems to come from the axios lib, I may be wrong.
👟 Reproduction steps
create a "ipv6 only" (as explained above) HTTP monitor, passing through a proxy.
👀 Expected behavior
The request is sent normally
to
[2a01:e0a:c99:6170:907b:a8ff:fe6c:4f3b]:443😓 Actual Behavior
the request is sent to an incorrect address :
2a01:443🐻 Uptime-Kuma Version
latest beta.1
💻 Operating System and Arch
Ubuntu 22.04
🌐 Browser
Doesn't matter.
🐋 Docker Version
Not running in docker
🟩 NodeJS Version
16
📝 Relevant log output
@CommanderStorm commented on GitHub (Aug 11, 2023):
First of all: Thank you for taking the time to write such a detailed issue.
I think this is a bug upstream, see https://github.com/axios/axios/issues/5333
⇒ I don't see us being able to solve this
⇒ leaving this issue open despite us not being able to do anything about this issue is reasonable
I don't think this needs to be a distinct monitor.
⇒ tracked in https://github.com/louislam/uptime-kuma/issues/1242
@SkwalExe commented on GitHub (Aug 12, 2023):
I bumped the axios version to 1.0.0 locally and uptime kuma started without any error. This fixed the issue
But now, the custom "Host" header doesn't validate the ssl certificate anymore for some reason.
I think we should use axios 1.0.0 since it is the only solution, and fix the ssl certificate valitation.
Also in the axios releases page there aren't any breaking changes from 0.27.0 (current version) to 1.0.0.
I read CONTRIBUTING.md and I know that the library shouldn't' be updated but it is the only solutions.
@CommanderStorm commented on GitHub (Aug 12, 2023):
Changes to dependency are also possible in case this solves bugs and does not introduce significant breaking changes.
We are currently at the start of the
v2.0Merge-window => even if this is breaking, we could merge this.Could you test if the following is a breaking change and propose a PR?
@chakflying commented on GitHub (Aug 12, 2023):
Please be aware that axios#5333 is a post 1.0 issue according to their report. I'm not sure how you got it working, but we should be careful to not break other things while fixing this.
@SkwalExe commented on GitHub (Aug 12, 2023):
@CommanderStorm,
When creating a monitor with the IP directly in the URL, and setting the Host header manually, I don't really know if the SSL certificate hosts are supposed to be compared to the Host header. So this behavior may not be a bug, someone should clarify that.
Validating the SSL cert with the Host header is useful because it allows the cert to be valid when creating a monitor with the IP directly in the URL field. If a feature allowing to enter the IP address to which send the requests without making any DNS requests is added than it is not a problem.
Also, what do you mean by
I need a monitor to only make requests to my servers using their IPv6 address because they are behind a reverse proxy, and there are two different configurations for IPv4 and IPv6 on the server that I am monitoring. I didn't see any solutions in #1242.
@SkwalExe commented on GitHub (Aug 12, 2023):
@chakflying, you're right. I think I know why it was working but it doesn't matter. Its a post 1.0.0 bug that was apparently fixed in axios#573.
The pr was created a week ago and has not been merged yet. So we will have to wait for the pr to be merged and for the next release to come out. Going from 0.27.0 to 1.4.0 doesn't include any (documented) breaking changes, you can check on the axios' release page.
@CommanderStorm commented on GitHub (Aug 12, 2023):
Yea, but that is because 1.x includes undocumented deprecations (at least I was unable to find the full notes the following statement is refering to) going from 0.x to 1.x:
There really is no way to know what changed, given that
⇒ What changes would need to be made is unclear to me.
⇒ This seems quite risky (but with a payoff and enough testing likely something we could include in the
v2.0release)Am I missing something?
@SkwalExe commented on GitHub (Aug 12, 2023):
Updating Axios may not be the solution. I took a look at the "fix pr" mentioned in 5731, and it doesn't seem to fix the error. I confirmed it by replicating the pr changes locally.
Also, I think I solved the axios bug locally, but found other bugs preventing me from configuring the proxy as I described in the issue description. This issue will be very hard to fix...
if you want to reproduce, here is how to fix the bug :
after npm install... etc, I edited the axios sources manually from the node_modules directory
the [] were not present in the ipv6 address and thus the first
:was treated a the separation between the IP and the portparsed.hostnamedoesn't contain the brackets, butparsed.hostdoes. So I just replacedparsed.hostnametoparsed.host