{"id":1803,"date":"2022-05-20T18:53:03","date_gmt":"2022-05-20T16:53:03","guid":{"rendered":"https:\/\/www.dsecbypass.com\/?p=1803"},"modified":"2022-09-27T08:28:54","modified_gmt":"2022-09-27T06:28:54","slug":"love-actuator","status":"publish","type":"post","link":"https:\/\/www.dsecbypass.com\/en\/love-actuator\/","title":{"rendered":"Love actuator"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;0px||||false|false&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_image src=&#8221;https:\/\/www.dsecbypass.com\/wp-content\/uploads\/2022\/05\/actuator_example.png&#8221; alt=&#8221;Apereo CAS actuator&#8221; title_text=&#8221;actuator_example&#8221; _builder_version=&#8221;4.17.4&#8243; _module_preset=&#8221;default&#8221; width=&#8221;50%&#8221; module_alignment=&#8221;center&#8221; height=&#8221;476px&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.17.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2>Apereo CAS<\/h2>\n<p style=\"text-align: justify;\">During a mission, a DSecBypass pentester was confronted with the Java Apereo CAS software. It was possible to bypass software-managed SSO authentication by exploiting a Spring Boot Actuator configuration flaw.<\/p>\n<blockquote>\n<p class=\"tw-data-text tw-text-large tw-ta\" data-placeholder=\"Traduction\" id=\"tw-target-text\" style=\"text-align: left;\" dir=\"ltr\"><span class=\"Y2IQFc\" lang=\"fr\">Enterprise SSO &#8211; CAS provides a friendly open source community that actively supports and contributes to the project. Although the project is rooted in higher education open source, it has grown to reach an international audience spanning Fortune 500 companies and small special-purpose facilities.<em>(<a href=\"https:\/\/www.apereo.org\/projects\/cas\">https:\/\/www.apereo.org\/projects\/cas<\/a>)<\/em><br \/><\/span><\/p>\n<\/blockquote>\n<p>The code can be found on the project&#8217;s GitHub: <a href=\"https:\/\/github.com\/apereo\/cas\">https:\/\/github.com\/apereo\/cas<\/a>.<\/p>\n<p>It is an effectively active project, strongly represented in higher education establishments in France and internationally.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.17.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2 class=\"part\" data-startline=\"14\" data-endline=\"14\">Spring Boot Actuator<\/h2>\n<p style=\"text-align: justify;\">Applications developed with the Java Spring MVC framework expose on their HTTP\/HTTPS services an <em>endpoint<\/em> called <em>actuator <\/em>(Spring Boot Actuator). As the <a href=\"https:\/\/docs.spring.io\/spring-boot\/docs\/1.3.5.RELEASE\/reference\/html\/production-ready-monitoring.html\" target=\"_blank\" rel=\"noopener\">Spring documentation<\/a> mentions, Actuator allows to monitor the health of the different services of the application and will expose all services by default. The developer has several possibilities to restrict access to these features:<em><br \/><\/em><\/p>\n<ul>\n<li>Include Spring Security in your project to secure Actuator endpoints with Basic HTTP authentication<\/li>\n<li><a href=\"https:\/\/docs.spring.io\/spring-boot\/docs\/1.3.5.RELEASE\/reference\/html\/production-ready-endpoints.html#production-ready-customizing-endpoints\" target=\"_blank\" rel=\"noopener\">Setting up Spring<\/a> so as to expose only a well-chosen list of functionalities<\/li>\n<li>Block access to actuator features using front-end equipment (reverse proxy, application firewall)<\/li>\n<\/ul>\n<h2>Attacks on Actuator<\/h2>\n<p style=\"text-align: justify;\">One of the fundamental principles of computer security is to limit the attack surface. In particular, for web applications in production, it is strongly recommended to disable or restrict access to unnecessary features for the end user.<\/p>\n<p style=\"text-align: justify;\">Actuator is one of those features that are not needed by the end user and should not be accessible. Indeed, some features are a direct threat to the security of the application:<\/p>\n<ul>\n<li>heapdump &#8211; dumps the contents of the process memory (heap)<\/li>\n<li>env &#8211; displays the value of application variables<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">The usual attack techniques are already covered in this article : <a href=\"https:\/\/www.veracode.com\/blog\/research\/exploiting-spring-boot-actuators\">https:\/\/www.veracode.com\/blog\/research\/exploiting-spring-boot-actuators<\/a>.<\/p>\n<p style=\"text-align: justify;\">\n<h2>Exploiting a vulnerable Apereo CAS server<\/h2>\n<p style=\"text-align: justify;\">Apereo CAS is no exception and can also expose actuator endpoints by accessing the path &#8220;https:\/\/VULNERABLE_CAS\/cas\/actuator&#8221;. A description of the available endpoints can be found in the following file : <a href=\"https:\/\/github.com\/apereo\/cas\/blob\/master\/docs\/cas-server-documentation-processor\/src\/main\/resources\/actuators.properties\">https:\/\/github.com\/apereo\/cas\/blob\/master\/docs\/cas-server-documentation-processor\/src\/main\/resources\/actuators.properties<\/a><\/p>\n<p style=\"text-align: justify;\">Although not common, some <strong>misconfigured<\/strong> CAS expose the actuator with the <em>env<\/em> or <em>heapdump<\/em> endpoints.<\/p>\n<p style=\"text-align: justify;\">In the case of <em>env,<\/em> simply reading the returned values will sometimes yield database accounts, internal IPs and URLs, and other potentially sensitive parameters.<\/p>\n<p style=\"text-align: justify;\">If <em>heapdump<\/em> is accessible, <strong>then CAS credentials<\/strong> can be retrieved from process memory using the following Linux command:<\/p>\n<blockquote>\n<p>curl -s https:\/\/VULNERABLE_CAS\/cas\/actuator\/heapdump | strings | grep -oE &#8220;username=(.*)&amp;execution&#8221;<\/p>\n<\/blockquote>\n<p style=\"text-align: justify;\">Be careful to perform these actions on applications that belong to you or for which you have received authorization to operate an intrusion test.<\/p>\n<p>&nbsp;<\/p>\n<h2>Securing Apereo CAS<\/h2>\n<p style=\"text-align: justify;\">Configuring Actuator endpoints is covered in the official documentation: <a href=\"https:\/\/apereo.github.io\/cas\/6.0.x\/monitoring\/Monitoring-Statistics.html\">https:\/\/apereo.github.io\/cas\/6.0.x\/monitoring\/Monitoring-Statistics.html<\/a>.<\/p>\n<p style=\"text-align: justify;\">It is mentionned that only <em>info<\/em>, <em>status<\/em>, <em>health<\/em> and <em>configurationMetadata <\/em>endpoints are exposed by default. You should therefore ensure that this is also the case in your application. In order to reduce the attack surface of Apereo CAS, it is also advisable not to expose the actuator URL (\/cas\/actuator\/*) on the Internet and to configure the authentication to access it with the following parameter:<\/p>\n<blockquote>\n<pre class=\"highlight\"><code id=\"code0\"><span class=\"py\">cas.monitor.endpoints.endpoint.status.access<\/span><span class=\"p\">=<\/span><span class=\"s\">AUTHENTICATED<\/span><\/code><\/pre>\n<\/blockquote>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text _builder_version=&#8221;4.17.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p style=\"text-align: justify;\"><span>\ud83d\udee1\ufe0f DSecBypass supports you in securing you applications during <a href=\"https:\/\/www.dsecbypass.com\/en\/website-pentest\/\">website pentests<\/a> or <a href=\"https:\/\/www.dsecbypass.com\/en\/external-pentest\/\">external pentests<\/a>, with quality services and significant experience in this type of service. Do not hesitate to <a href=\"https:\/\/www.dsecbypass.com\/en\/dsecbypass-contact-cybersecurity-company-lyon\/\">contact <\/a>us for additional information and\/or a personalized quote \ud83d\udcdd.<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_button button_url=&#8221;https:\/\/www.dsecbypass.com\/en\/contact\/&#8221; button_text=&#8221;CONTACT US&#8221; button_alignment=&#8221;center&#8221; _builder_version=&#8221;4.17.4&#8243; _module_preset=&#8221;default&#8221; custom_button=&#8221;on&#8221; button_text_size=&#8221;13px&#8221; button_bg_color=&#8221;#4328b7&#8243; button_border_width=&#8221;10px&#8221; button_border_color=&#8221;#4328b7&#8243; button_border_radius=&#8221;0px&#8221; button_letter_spacing=&#8221;2px&#8221; button_font=&#8221;Titillium Web|700||on|||||&#8221; background_layout=&#8221;dark&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_button][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During a mission, a DSecBypass pentester was confronted with the Java Apereo CAS software. It was possible to bypass software-managed SSO authentication by exploiting a Spring Boot Actuator configuration flaw.<\/p>\n","protected":false},"author":4,"featured_media":1661,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[34],"tags":[],"class_list":["post-1803","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-en"],"_links":{"self":[{"href":"https:\/\/www.dsecbypass.com\/en\/wp-json\/wp\/v2\/posts\/1803","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dsecbypass.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dsecbypass.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dsecbypass.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dsecbypass.com\/en\/wp-json\/wp\/v2\/comments?post=1803"}],"version-history":[{"count":18,"href":"https:\/\/www.dsecbypass.com\/en\/wp-json\/wp\/v2\/posts\/1803\/revisions"}],"predecessor-version":[{"id":2475,"href":"https:\/\/www.dsecbypass.com\/en\/wp-json\/wp\/v2\/posts\/1803\/revisions\/2475"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dsecbypass.com\/en\/wp-json\/wp\/v2\/media\/1661"}],"wp:attachment":[{"href":"https:\/\/www.dsecbypass.com\/en\/wp-json\/wp\/v2\/media?parent=1803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dsecbypass.com\/en\/wp-json\/wp\/v2\/categories?post=1803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dsecbypass.com\/en\/wp-json\/wp\/v2\/tags?post=1803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}