A10 Networks ACOS Critical Insecure Cookie Vulnerability 1 of 2

The following summarizes an HTTP persistence cookie vulnerability that I identified in A10’s ACOS ADC software. This issue was disclosed to A10 Networks in June 2016 and has since been resolved.

A10 Networks Cookie Vulnerability

This vulnerability results in information disclosure about names of service-groups and IPs of real servers, as well as the ability to manipulate the content of the cookies.

SUMMARY OF VULNERABILITY

The ACOS documentation for HTTP persistence cookies notes that “For security, address information in the persistence cookies is encrypted.” However, the address information is not “encrypted”; rather, the real server IP and port information is weakly obfuscated and is easily decoded, exposing information about the internal network. The simplicity of the obfuscation also makes it trivial to manually create a cookie which ACOS would decode and honor.

Additionally, cookies configured using the service-group command option have the service-group’s full name included in the persistence cookie as plain text. This vulnerability applies to HTTP/HTTPS VIP types that have been configured to use a cookie-based persistence template.

SOFTWARE VERSIONS TESTED

This vulnerability was discovered and validated initially in ACOS 2.7.2-P4-SP2 and reconfirmed most recently in ACOS 4.1.1-P3.

VULNERABLE VERSIONS

This behavior has been core to persistence cookies until now, so it can be reasonably stated that this vulnerability exists in:

  • ACOS 2.7.2 initial release and up to 2.7.2-P10 inclusive
  • ACOS 4.0 initial release up to 4.1.1-P5 inclusive

WORKAROUNDS

Without upgrading to a fixed version of code, the only workaround is to stop using persistence based cookies.

FIXED-IN

A10 Networks has issued updated software which include a fix for this vulnerability (cookies are now encrypted):

  • ACOS 2.7.2-P11 (June 2017)
  • ACOS 4.1.1-P6 (November 2017)

AUTHOR / DISCOVERER

John Herbert (http://movingpackets.net)

Vulnerability Details

HTTP persistence cookies generated by A10 ACOS (Advanced Core Operating System) can take one of four forms depending on the configuration:

Cookie Match-Type OptionsCookie Will Contain
(none)(default) Real server IP and port
serverReal server IP
service-groupService-group + real server IP and port
server service-groupService-group + real server IP

The persistence cookie sent to the client will therefore take one of the following forms, assuming a real server/port selection of 10.100.200.1/80, where [vport] represents an integer that the documentation claims is the vport (though it is presumably actually an internal identifier for the vport, usually comprising 5 digits), and [sg-name] is the name of the service-group from which the real server was selected:

Cookie Name FormatCookie Value
sto-idABMIGEAK
sto-id-[vport]ABMIGEAKFAAA
sto-id-[sg-name]ABMIGEAK
sto-id-[sg-name]-[vport]ABMIGEAKFAAA

Service-Group Name Disclosure

The [sg-name] field is a plain text copy of the VIP name configured in ACOS. For example:

The remote user now knows the internally-configured name of the A10 service-group, which is a minor, but unnecessary, information disclosure.

Real Server IP and Port Disclosure

Of more concern is the fact that the IP and port in use on the selected real server are disclosed in the cookie. These data are stored in the cookie using a trivial encoding which at best could be described as obfuscation, but certainly not as encryption. The high level format is simple:

IP Encoding Method

The IP encoding works as follows, using 10.100.200.1, port 25565 as an example:

  1. Split the IP into the four component octets:

  1. Reverse the order of the octets:

  1. For each number [N], calculate [N] div 16 (the number of times 16 goes into N) and [N] mod 16 (the remainder after division by 16):

  1. Write the numbers out in a row, reading the table above from left to right, top to bottom:

  1. Add 65 to each number:

  1. Print the ASCII character with that value:

  1. The resulting “encrypted” IP is ABMIGEAK.

Port Encoding Method

The port encoding is slightly more complex, but follows a similar logic:

  1. Start with the port number (0-65535)

  1. Calculate 25565 div 4096

  1. Multiply result #1 by 4096 and subtract that from the port number:

  1. Calculate 989 div 256

  1. Multiply result #2 by 256 and subtract from 989:

  1. Calculate 221 div 16

  1. Calculate 221 mod 16 (note that this step is mod, not div)

  1. Reorder the results 1-4 from above in the order #3, #4, #1, #2

  1. Add 65 to each value and print the ASCII character with that value:

  1. The resulting “encrypted” port is NNGD.

Thus, 10.100.200.1 port 25565 would be encoded in the persistence cookie as ABMIGEAK NNGD.

It is perhaps obvious that as easily as this cookie value can be decoded, a cookie value can be encoded by a malicious user to encapsulate any arbitrary port and IP combination.

Recommendation

Users of A10 Networks ACOS 2.7.2 and 4.x using cookie-based persistence should upgrade immediately to the fixed-in versions outlined above.

Be the first to comment

Leave a Reply

Your email address will not be published.


*


 

This site uses Akismet to reduce spam. Learn how your comment data is processed.