Deze week zijn in enkele Spring modules vulnerabilities aan het licht gekomen. Minimaal een lijkt er ernstig van aard en daarom reden om hier vanuit Team Rockstars aandachtig naar te kijken.

Hieronder beschrijven we het probleem, verwijzen we naar nuttige ander pagina’s en komen we met oplossingen.

HET SECURITY PROBLEEM

Zoals aangegeven zijn er meerdere security problemen binnen enkele Spring modules. Via onderstaande links ga je naar artikelen die deze problemen op een goede manier beschrijven: https://www.cyberkendra.com/2022/03/springshell-rce-0-day-vulnerability.html

Hoe: https://www.cyberkendra.com/2022/03/spring4shell-details-and-exploit-code.html

Zoals aangegeven is er een zeer serieuze vulnerability, in onderstaande github omgeving is een exploit geïmplementeerd waar je het probleem mee kunt naspelen: https://github.com/DissiNL/Spring4Shell

HET PROBLEEM OPLOSSEN

Donderdag 31 maart zijn er diverse updates van Spring modules beschikbaar gekomen waarin de vulnerabilities opgelost zijn. Je kunt het beste de Spring modules upgraden.

Mocht dat onverhoopt niet mogelijk zijn dan kun je de vulnerability ook zelf dichtzetten. In onderstaande Github omgeving staat alle informatie die je daarvoor nodig hebt: https://github.com/DissiNL/Spring4Shell/blob/master/src/main/java/com/dissi/serializationdemo/BinderControllerAdvice.java#L10-L19

developers only

Hieronder staat allerlei informatie die we nodig hadden om tot bovenstaande probleembeschrijving, exploit en oplossingen te komen. Wil je weten hoe het in detail werkt dan kan het interessant zijn om ook deze informatie te bekijken.

 

We’ve added a simple workaround example in the readme. The exploit can be enabled on demand https://github.com/DissiNL/Spring4Shell/blob/master/README.md 

WAF protection

On network protection devices such as WAF, implement rule filtering for strings such as

Kopiëren

according to the actual traffic situation of deployed services. After filtering the rules, test the business operation to avoid additional impact.

Detectie van exploit door middel van SNORT (IDS/IPS) Rules:

Onderstaande Rules kunnen in iedere IDS geladen worden die Snort Rules ondersteund (bijvoorbeeld Snort en Suricata). Deze rules zijn getest en ontwikkeld op basis van het netwerk verkeer dat gegenereerd wordt door de POC exploit gepubliceerd door LunaSec. Mogelijk detecteren deze rules niet alle exploits af die er “in het wild” gebruikt (gaan) worden. Gebruik ze daarom als onderdeel van een gelaagde beveiliging en vertrouw niet blind op deze rules. Let op: Deze rules werken alleen voor HTTP verkeer en kunnen dus niet in TLS (HTTPS) verkeer kijken (tenzij daarvoor specifieke maatregelen zijn genomen).

Kopiëren

Detectie van exploit door middel van YARA Rules:

De YARA rules op de hieronder gepubliceerde Git Repository kunnen helpen om in logs (licht gemodificeerde) Proof-Of-Concept exploit-code op te sporen. https://github.com/Neo23x0/signature-base/blob/master/yara/expl_spring4shell.yar

Handreiking hoe te handelen bij Spring4Shell:

IDENTIFY:
  • What (company) assets are using Spring Core?
  • Which version are they on?
  • Are they part of my “Crown Jewels”?
  • Which parts of my proces rely on these assets?
  • What happens when these assets get compromised or need to be shut down?

PROTECT:

  • Is it possible to separate these assets from the rest of my network and infrastructure until i can mitigate the issue or release a fix?
  • If not, can I take any other measures to protect the rest of my infrastructure? (Additional firewalling, Limiting access from untrusted sources, etc..)

DETECT:

  • Can I detect any malicious activity relating to Spring4Shell?
  • Yara Rules
  • Log Analysis / SIEM
  • IDS Rules

RESPOND:

  • Prepare:
  • Create a response plan. Consider:
  • Communications (who needs to know and when?)
  • Analyze the possible impact
  • Mitigation and Containment
  • Consider incorporating forensics

ACTUAL RESPONSE:

  • Activate your response plan, or if you don’t have one:
  • Inform critical stakeholders
  • Analyze the impact of the breach/incident
  • Isolate affected systems and mitigate the incident on these systems
  • Check the rest of your infrastructure for indicators of compromise if you are not sure if containment was sufficient

RECOVER:

  • Activate Response or Business Continuity plans
  • Communicate to critical stakeholders what happened and what the expected timeline for recovery is
  • Restore affected systems and patch vulnerabilities before going live
  • Evaluate what has happened
Mark Bertels is Special Agent en Solutions Architect bij Team Rockstars IT

Met MARK sparren over SECURITY OPLOSSINGEN?