Comments (9)
Hello , I came from necko
matrix , i made some test for you. hope it helps.
Result:
1)
User/password testproxy:äääää
curl
2023/09/14 22:41:05.000629105 length=22 from=5 to=26
01 09 74 65 73 74 70 72 6f 78 79 0a ..testproxy.
c3 a4 c3 a4 c3 a4 c3 a4 c3 a4 ..........
foxy
2023/09/14 22:42:22.000376446 length=17 from=3 to=19
01 09 74 65 73 74 70 72 6f 78 79 05 e4 e4 e4 e4 ..testproxy.....
e4
Since ä has a 0xe4 format (which may not exceed uchar 255 ) , i tested a more complex password
User/password chinese:你好
curl
2023/09/14 22:47:07.000277102 length=16 from=5 to=20
01 07 63 68 69 6e 65 73 65 06 e4 bd a0 e5 a5 bd ..chinese.......
--
foxy
2023/09/14 22:47:56.000581016 length=12 from=3 to=14
01 07 63 68 69 6e 65 73 65 02 60 7d ..chinese.`}
--
from firefox-extension.
Some further digging:
After this line https://searchfox.org/mozilla-central/source/toolkit/components/extensions/ProxyChannelFilter.sys.mjs#232 , the password in proxyInfo
is changed from "你好" to "`}"
I guess that when passing from JavaScript to c , password (in type ACString) is treat as narrow string , but underlying wide string.
I just do a test , set host
to "你好" in foxy and then proxyInfo
.host is just the same , because its type is AUTF8String so the JavaScript to c conversion is correct.
Ref https://searchfox.org/mozilla-central/source/netwerk/base/nsIProtocolProxyService.idl#194
Ref https://firefox-source-docs.mozilla.org/xpcom/stringguide.html
Not sure if changing idl
will fix this
https://searchfox.org/mozilla-central/source/__GENERATED__/dist/include/nsIProtocolProxyService.h#102-103
/* nsIProxyInfo newProxyInfoWithAuth (in ACString aType, in AUTF8String aHost, in long aPort, in ACString aUsername, in ACString aPassword, in ACString aProxyAuthorizationHeader, in ACString aConnectionIsolationKey, in unsigned long aFlags, in unsigned long aFailoverTimeout, in nsIProxyInfo aFailoverProxy); */
NS_IMETHOD NewProxyInfoWithAuth(const nsACString& aType, const nsACString& aHost, int32_t aPort, const nsACString& aUsername, const nsACString& aPassword, const nsACString& aProxyAuthorizationHeader, const nsACString& aConnectionIsolationKey, uint32_t aFlags, uint32_t aFailoverTimeout, nsIProxyInfo *aFailoverProxy, nsIProxyInfo **_retval) = 0;
in idl host is AUTF8String , but in c definition it is also nsACString.
So i guess change username/password in idl from ACString to AUTF8String would help ?
from firefox-extension.
The underlying Firefox code does not support Unicode or multi-byte characters string for SOCKS5 usernames and passwords. Here is my analysis:
WriteV5UsernameRequest() writes the username/password to the SOCKS5 connection:
// RFC 1929 Username/password auth for SOCKS 5
LOGDEBUG(("socks5: sending username and password"));
mDataLength = Buffer<BUFFER_SIZE>(mData)
.WriteUint8(0x01) // version 1 (not 5)
.WriteUint8(mProxyUsername.Length()) // username length
.WriteString<MAX_USERNAME_LEN>(mProxyUsername) // username
.WriteUint8(password.Length()) // password length
.WriteString<MAX_PASSWORD_LEN>(
password) // password. WARNING: Sent unencrypted!
.Written();
RFC 1929, mentioned in the comment, does not say anything about username/password character encoding or Unicode. It is from 1996 when Unicode was not yet too common.
Anyway, that function uses WriteString to write the character string into the buffer:
template <size_t MaxLength>
Buffer<Size - MaxLength> WriteString(const nsACString& aStr) {
if (aStr.Length() > MaxLength) {
return Buffer<Size - MaxLength>(nullptr);
}
return WritePtr<char, MaxLength>(aStr.Data(), aStr.Length());
}
WriteString
takes an argument of type nsACString:
// Single-byte (char) string types.
using nsACString = nsTSubstring<char>;
I'm not diving any deeper to see what nsTSubString
is because the comment above says 'single-byte (char) string types'. That excludes Uniode and multi-byte strings such as 你好 and ä.
from firefox-extension.
I tested a build of firefox with change username/password in idl from ACString to AUTF8String and it helps.
So i opened a ticket in mozilla bugizlla https://bugzilla.mozilla.org/show_bug.cgi?id=1853203.
from firefox-extension.
Can you please test with FoxyProxy v8.0?
If the issue is not fixed in v8.0, please post to that repository for further investigation.
from firefox-extension.
@erosman I changed the Dante socks proxy user password to huhuäbubu and the dante socks proxy connection through FoxyProxy v8.0 stopped working at once. Then I changed the dante socks proxy user password to something that doesn't contain ä and FoxyProxy v8.0 started working again.
from firefox-extension.
FoxyProxy doesn't alter the user/pass and sends them as they are.
It is possible that Firefox encodes them and/or Dante expects encoded Unicode.
Do you have access to the transmitted data?
If so, please check:
- How does Firefox send the data?
- Does it send as
äääää
or%C3%A4%C3%A4%C3%A4%C3%A4%C3%A4
?
- Does it send as
- How does Dante receive the data?
- Does it accept
äääää
or%C3%A4%C3%A4%C3%A4%C3%A4%C3%A4
?
- Does it accept
Have you tried it with any other socks proxy server?
from firefox-extension.
@jackyzy823 Thank you for all the help.
from firefox-extension.
Issues is Fixed in Firefox 119.
from firefox-extension.
Related Issues (20)
- Spelling error
- Storing password in plain text HOT 4
- Support large pattern HOT 2
- github.chriisti.mulesoft
- Is it possible to import settings from a file? My goal is to have a pre-configured proxy that can be used without having to first import settings by using the import-function in the browser or adding a proxy manually. HOT 1
- Import-export settings does just that. You can edit it and import the edited one. HOT 1
- [Feature request] Optional static toolbar icon HOT 2
- Synchronize Settings doesn't work HOT 1
- HTTPS proxy only works when added as HTTP (no S) Proxy Type HOT 1
- Grammar mistake HOT 4
- Do not show disabled proxy HOT 1
- Broken functionality with SOCKS5 proxy HOT 2
- Sort proxies by availability check result HOT 7
- FoxyProxy Standard Slows Down Firefox Startup Time
- Network detection feature. HOT 1
- Please add keyboard shorcuts HOT 3
- Unable to intercept localhost HOT 1
- Proxy is in effect even when disabled HOT 1
- Proxy by patterns not working if firefox users change their userAgent to another platform HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firefox-extension.