You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We (my team and I) are using your radius library for a while now and I must say we are very happy with it.
It work very fast and gets the job done. We use it to process thousands of requests per minute and it does it like a boss.
A couple of weeks ago we started working on implementing webRTC in one of our web applications.
To get it working we send a JWT (JSON Webtoken) token to our SIP server (Brekeke) along with the register request using the JsSIP javascript library.
We do this because we don't want to show the password of the SIP account in plain text in our client-side application. We use the Vendor-Specific attributes (dictionaries) to pass this JWT token to our node radius process. We then validate the JWT token in our authentication process after we decoded the RADIUS packet using your library. This worked fine and we could register the SIP account and make calls and everything.
But here comes the problem. We noticed that sometimes our SIP server sends malformed RADIUS packets to our radius service (random). And we know we have to fix this on our side but something happened in the decode process of your radius lib. It created a memory leak causing the node app to crash.
This memory leak occurs when the length variable in the decode_attributes function is 0.
Because the attributes are decoded inside a while loop: while (data.length > 0) / data = data.slice(length);
and the length variable used to slice the data is 0, it will stay in this loop untill the raw_attrs variable is so big, it eats up too much memory.
Off course we can easily fix this with the following line:
if (!length) throw new Error("readUInt8(1) has length of 0");
You can reproduce this issue using a buffer I provided: corrupBuffer.txt
I hope we can discuss this problem and hopefully come to a solution.
With regards,
Mark Horsman
Tam One
The text was updated successfully, but these errors were encountered:
Dear colleague developer,
We (my team and I) are using your radius library for a while now and I must say we are very happy with it.
It work very fast and gets the job done. We use it to process thousands of requests per minute and it does it like a boss.
A couple of weeks ago we started working on implementing webRTC in one of our web applications.
To get it working we send a JWT (JSON Webtoken) token to our SIP server (Brekeke) along with the register request using the JsSIP javascript library.
We do this because we don't want to show the password of the SIP account in plain text in our client-side application. We use the Vendor-Specific attributes (dictionaries) to pass this JWT token to our node radius process. We then validate the JWT token in our authentication process after we decoded the RADIUS packet using your library. This worked fine and we could register the SIP account and make calls and everything.
But here comes the problem. We noticed that sometimes our SIP server sends malformed RADIUS packets to our radius service (random). And we know we have to fix this on our side but something happened in the decode process of your radius lib. It created a memory leak causing the node app to crash.
This memory leak occurs when the length variable in the decode_attributes function is 0.
Because the attributes are decoded inside a while loop:
while (data.length > 0) / data = data.slice(length);
and the length variable used to slice the data is 0, it will stay in this loop untill the raw_attrs variable is so big, it eats up too much memory.
Off course we can easily fix this with the following line:
if (!length) throw new Error("readUInt8(1) has length of 0");
You can reproduce this issue using a buffer I provided:
corrupBuffer.txt
I hope we can discuss this problem and hopefully come to a solution.
With regards,
Mark Horsman
Tam One
The text was updated successfully, but these errors were encountered: