Update 31-03-2022
Update 01-04-2022
Access42 volgt de updates met betrekking tot Spring4Shell op de voet. Naarmate er meer informatie beschikbaar komt, zullen we deze blog bijwerken met aanvullende details over de kwetsbaarheid, inclusief eventuele detectie mogelijkheden.
Spring4Shell is de bijnaam van een zero-day kwetsbaarheid in het Spring Core Framework. Het Spring Core Framework is een set van Java libraries waarmee op gestructureerde wijze applicaties kunnen worden ontwikkeld die vervolgens zowel standalone kunnen draaien of in webapplicatie-omgevingen als Tomcat.
bronnen: Access42, Tenable, Lunasec, NCSC, Preatorian
Er bestaan twee RCE’s en er worden online drie vectoren besproken (waarvan er één niet bekend staat als exploiteerbaar op afstand).
Er zijn updates beschikbaar voor Spring4Shell in Spring versions 5.3.18 and 5.2.20 en een officiële CVE is gepubliceerd als CVE-2022-22965.
Spring Framework-versies 5.3.18 en 5.2.20, die de kwetsbaarheid aanpakken, zijn al beschikbaar op Maven Central. Als u kunt upgraden, hebt u de onderstaande tijdelijke oplossingen niet nodig.
Als je Spring Core gebruikt, is dit momenteel de enige bekende remedie voor het patchen van deze aanval. Er is ten tijde van het publiceren van deze blog geen patch beschikbaar (vanaf 3-31-2022 @ 9:30am).
Volgens de Praetorian post die de aanwezigheid van een RCE in Spring Core bevestigt, is momenteel de aanbevolen aanpak om DataBinder te patchen een blacklist toe te voegen van kwetsbare veldpatronen die nodig zijn voor exploitatie.
In Spring Framework heeft DataBinder functionaliteit om bepaalde patronen te weigeren. Als tijdelijke oplossing voor deze kwetsbaarheid raden wij aan om een ControllerAdvice component te maken (een Spring component die gedeeld wordt door Controllers) en gevaarlijke patronen aan de denylist toe te voegen. Een voorbeeld snippet is hieronder te zien:
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.InitBinder;
@ControllerAdvice
@Order(10000)
public class BinderControllerAdvice {
@InitBinder
public void setAllowedFields(WebDataBinder dataBinder) {
String[] denylist = new String[]{"class.*", "Class.*", "*.class.*", "*.Class.*"};
dataBinder.setDisallowedFields(denylist);
}
}
Op het moment dat dit blogbericht werd gepubliceerd, was er nog geen CVE-ID bekend voor deze kwetsbaarheid.
Hoewel de naam zelf is geïnspireerd door Log4Shell (CVE-2021-44228), zijn de twee niet verwant.
Op het moment dat deze blog post werd gepubliceerd, was er nog geen patch beschikbaar voor deze kwetsbaarheid. Vanaf 31 maart zijn Spring Framework versies 5.3.18 en 5.2.20 vrijgegeven. Volgens de kwetsbaarheidsmelding van Spring, zijn Spring Boot versie 2.6.6 en 2.5.12 (beide afhankelijk van Spring Framework 5.3.18) vrijgegeven.
Een aanvaller zou Spring4Shell kunnen misbruiken door een speciaal bewerkt verzoek naar een kwetsbare server te sturen. Uitbuiting van Spring4Shell vereist echter bepaalde vereisten, terwijl de oorspronkelijke Log4Shell-kwetsbaarheid alle versies van Log4j 2 trof met de standaardconfiguratie.
Volgens Spring zijn de volgende vereisten opgenomen in het kwetsbaarheidsrapport, maar het bericht waarschuwt dat er andere manieren kunnen zijn waarop dit kan worden uitgebuit, zodat dit op dit moment mogelijk geen volledige lijst van vereisten is:
Meerdere onderzoekers publiceren bevindingen in de vereisten voor exploitatie op Twitter:
We're taking a look into the "possible RCE in Spring Core" that's been circulating around. From looking at the commits in Spring it seems like it has many mitigating factors, but we'll follow up with more details soon. https://t.co/u58FfMB5di
— LunaSec (@LunaSecIO) March 30, 2022
The prerequisites:
— Will Dormann (@wdormann) March 30, 2022
– Uses Spring Beans
– Uses Spring Parameter Binding
– Spring Parameter Binding must be configured to use a non-basic parameter type, such as POJOs
All this smells of "How can I make an app that's exploitable" vs. "How can I exploit this thing that exists?"
Het is onduidelijk hoe “standaard” deze vereisten zijn en hoe vaak ze voorkomen. Aangezien deze noodzakelijk zijn voor exploitatie, verwachten wij dat de impact van Spring4Shell veel beperkter zal zijn dan die van Log4Shell.
Vanaf 31 maart zijn Spring versies 5.3.18 en 5.2.20 uitgebracht om CVE-2022-22965 aan te pakken. Op het moment dat deze blog werd geüpdatet was nog niet expliciet vermeld welke versies zijn getroffen, maar we hopen snel meer duidelijkheid te hebben en zullen deze post bijwerken met aanvullende informatie.
Het gebruik van JDK 9+ en Spring Framework samen betekent niet noodzakelijkerwijs dat je kwetsbaar bent voor Spring4Shell, aangezien de applicatie zodanig geconfigureerd moet zijn dat een aanvaller het lek kan misbruiken. Spring heeft bijvoorbeeld aanbevolen dat ontwikkelaars de eigenschap allowedFields specificeren wanneer ze de DataBinder class gebruiken. Onderzoekers hebben bevestigd dat het niet specificeren van deze eigenschap een aanvaller in staat kan stellen Spring4Shell te gebruiken tegen een kwetsbare applicatie.
Onderzoekers van Praetorian hebben bevestigd dat Spring4Shell een patch bypass is van CVE-2010-1622, een code-injectie lek in het Spring Core Framework dat naar verluidt bijna 12 jaar geleden is opgelost. De onderzoekers zeggen echter dat de oplossing voor CVE-2010-1622 onvolledig was en dat er een nieuw pad is om dit oude lek uit te buiten.
Nee, dit zijn twee volledig ongerelateerde kwetsbaarheden. CVE-2022-22963 is een kwetsbaarheid in de Spring Cloud Function, een serverless framework voor het implementeren van business logica via functies. Een advisory voor CVE-2022-22963 werd gepubliceerd op 29 maart en patches voor Spring Cloud Function zijn beschikbaar.
Omdat er ten tijde van de openbaarmaking geen CVE voor Spring4Shell was toegewezen, werd Spring4Shell ten onrechte geassocieerd met CVE-2022-22963.
Ja, er zijn meerdere werkende proof-of-concept (PoC) exploits beschikbaar voor zowel Spring4Shell als CVE-2022-22963.
Een lijst van Tenable-plugins om deze kwetsbaarheid te identificeren, is hier te vinden.
Voor Nessus plugin ID 159374, “Spring Framework < 5.2.20 / 5.3.x < 5.3.18 Remote Code Execution (CVE-2022-22965),” moeten gebruikers de instelling “Show potential false alarms”, ook bekend als paranoïde modus, inschakelen in hun scanbeleid om deze plugin in een scan in te schakelen. Daarnaast moet ook de instelling “Peform thorough tests” zijn ingeschakeld.
Wij raden ook aan alleen deze specifieke plugin in een paranoïde scan in te schakelen. Scanbeleid dat is geconfigureerd om alle plugins in te schakelen zal een toename in het aantal triggers zien, omdat het alle paranoïde plugins tijdens de scan zal omvatten. Hieronder een overzicht van de instellingen voor Nessus en Tenable.io:
Enabling Paranoid and Thorough Tests Modes
To enable this setting for Nessus and Tenable.io users:
To enable this setting for Tenable.sc (formerly SecurityCenter) users:
Plugin ID 159374 is available in feed serial 202203311743.
For Web Application Scanning customers, we’ve updated our Backdoor Detection plugin to detect the tomcatwar.jsp shell file.
Cookie | Duration | Description |
---|---|---|
_GRECAPTCHA | 5 months 27 days | This cookie is set by Google. In addition to certain standard Google cookies, reCAPTCHA sets a necessary cookie (_GRECAPTCHA) when executed for the purpose of providing its risk analysis. |
cookielawinfo-checkbox-advertisement | 1 year | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Advertisement". |
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
CookieLawInfoConsent | 1 year | Records the default button state of the corresponding category & the status of CCPA. It works only in coordination with the primary cookie. |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
Cookie | Duration | Description |
---|---|---|
bcookie | 2 years | This cookie is set by linkedIn. The purpose of the cookie is to enable LinkedIn functionalities on the page. |
lang | session | This cookie is used to store the language preferences of a user to serve up content in that stored language the next time user visit the website. |
lidc | 1 day | This cookie is set by LinkedIn and used for routing. |
Cookie | Duration | Description |
---|---|---|
YSC | session | This cookies is set by Youtube and is used to track the views of embedded videos. |
Cookie | Duration | Description |
---|---|---|
_ga | 2 years | This cookie is installed by Google Analytics. The cookie is used to calculate visitor, session, campaign data and keep track of site usage for the site's analytics report. The cookies store information anonymously and assign a randomly generated number to identify unique visitors. |
_gat_gtag_UA_116473530_1 | 1 minute | This cookie is set by Google and is used to distinguish users. |
_gat_UA-116473530-1 | 1 minute | This is a pattern type cookie set by Google Analytics, where the pattern element on the name contains the unique identity number of the account or website it relates to. It appears to be a variation of the _gat cookie which is used to limit the amount of data recorded by Google on high traffic volume websites. |
_gid | 1 day | This cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the website is doing. The data collected including the number visitors, the source where they have come from, and the pages visted in an anonymous form. |
Cookie | Duration | Description |
---|---|---|
bscookie | 2 years | This cookie is a browser ID cookie set by Linked share Buttons and ad tags. |
IDE | 1 year 24 days | Used by Google DoubleClick and stores information about how the user uses the website and any other advertisement before visiting the website. This is used to present users with ads that are relevant to them according to the user profile. |
prism_476809757 | 1 month | Used by ActiveCampaign to track usage of newsletters |
test_cookie | 15 minutes | This cookie is set by doubleclick.net. The purpose of the cookie is to determine if the user's browser supports cookies. |
VISITOR_INFO1_LIVE | 5 months 27 days | This cookie is set by Youtube. Used to track the information of the embedded YouTube videos on a website. |
yt-remote-connected-devices | never | YouTube sets this cookie to store the video preferences of the user using embedded YouTube video. |
yt-remote-device-id | never | YouTube sets this cookie to store the video preferences of the user using embedded YouTube video. |
Cookie | Duration | Description |
---|---|---|
AnalyticsSyncHistory | 1 month | No description |
CONSENT | 16 years 7 months 5 days 13 hours | No description |
li_gc | 2 years | No description |
UserMatchHistory | 1 month | Linkedin - Used to track visitors on multiple websites, in order to present relevant advertisement based on the visitor's preferences. |