Skip to content

Out-of-Bound (OOB) Write Memory Flow CVE–2022-0995

Introduction:

An out-of-bounds (OOB) memory write flaw was found in the Linux kernel’s watch_queue event notification subsystem. This flaw can overwrite parts of the kernel state, potentially allowing a local user to gain privileged access or cause a denial of service on the system. Vulnerability Release Time:
  • 2022-03-14 11:43 UTC
Vulnerability Impact & Type
  • Successful exploitation of this vulnerability could lead to disclosure of sensitive information, addition or modification of data, or Denial of Service (DoS).
  • Privilege Escalation
Affected Products:
  • This vulnerability exist in all Linux versions up to 5.17 RC1 till RC7
Fixed Versions
  • Kernel 5.17 RC8 and above
Severity: The software writes data past the end, or before the beginning, of the intended buffer. This typically occurs when the pointer or its index is incremented or decremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in corruption of sensitive information, a crash, or code execution among other things. CVSS v3.1:
  • Base Score: 7.2 (High)
  • CWD ID: 787
  • Vulnerability type: Low
  • Gained Access: None
  • Authentication: None
  • Confidentiality Impact: Complete
  • Integrity Impact: Complete
  • Availability Impact: Complete
  • Access Complexity: Low
Mitigation: Mitigation for this issue is either not available or the currently available options don’t meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability Technical Analysis / Exploits: 1. Login to my linux machine as a normal user and shown the linux version I’m using. 2. Now let’s download exploit data in our local machine. Use below command to successfully download exploit data from github repository:
git clone https://github.com/Bonfee/CVE-2022-0995.git
3. After cloning the repository, change current directory to downloaded repository directory using below command: cd CVE-2022-0995 After the script completes its execution, you will successfully get the root user shell. ./exploit 4. After the script completes its execution, you will successfully get the root user shell. 5. Now, use below command to get bash shell of root user: /bin/bash/ Now you are at root user bash shell and you can do everything as a root user. Reference:
● https://github.com/Bonfee/CVE-2022-0995
● https://nvd.nist.gov/vuln/detail/CVE-2022-0995
● https://access.redhat.com/security/cve/cve-2022-0995
#CVE–2022-0995 #Linux #kernel #Out-of-Bound(OOB)

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About VRX
VRX is a consolidated vulnerability management platform that protects assets in real time. Its rich, integrated features efficiently pinpoint and remediate the largest risks to your cyber infrastructure. Resolve the most pressing threats with efficient automation features and precise contextual analysis.

The Dark Stuff – Tor – Continued

Intro

We talked about how to access the tor network, what it is, what a tor circuit and torrc file are, and other stuff. For this one, I’d like to focus on some of the core Tor concepts, as well as possible considerations, issues, weaknesses, risks inherent to Tor, and their appropriate management and mitigation.

Hidden services

This is basically just a relay that offers a web service or any other Internet service; A hidden service is a type of service that’s accessible only through a .onion URL, and its actual IP address is basically hidden behind the Tor circuit.

To host a hidden service, you need to install a web server or any other service you want to host; add this to your torrc file:

HiddenServiceDir /var/lib/tor/service


HiddenServicePort 80 <ip>:80

Tor will then generate a public-private key pair for your service, and it will write it to a file called private_key. It will also create a hostname file.

example –

/var/lib/tor/service/private_key                 


/var/lib/tor/hostname

The hostname file will have the name of your .onion address, as well as the information about your public key.

Obviously, to run a service such as this, you need to know what’s at stake, and if you’re doing it in the first place, you’re probably of the general idea to hide your IP; thus, you should appropriately harden your systems and take the risks into account.

This can be achieved in a myriad of ways, so I like to ponder these topics from a more general/high-level perspective. One possible way to isolate yourself is true virtualization and compartmentalization. Whoonix also comes to mind, as its double VMs setup makes all your traffic routed through the Whoonix gateway, and both of these systems are hardened and preconfigured out-of-the-box, of course, they should be reconfigured if necessary. This would be one example of how you might make it harder for attackers to figure out your real IP address.

However, I am not an expert on how to run hidden services, far from it, I just wanted to sort of ‘define’ them, so I can tie them into our whole narrative here.

Tor2web

Tor2web lets you access hidden service with a standard web browser. (No connection to the Tor network)

Basically, wherever you see a .onion URL, you can replace it with .onion.to, .onion.city, .onion.cab, .onion.direct, etc. Note that this is not anonymous, private or anything like that. This is just a way of accessing without connecting to the Tor network.

From the Tor2web site:

WARNING: Tor2web only protects publishers, not readers. As a reader installing Tor Browser will give you much greater anonymity, confidentiality, and authentication than using Tor2web. Using Tor2web trades off security for convenience and usability.

Tor – reflections – .onion URLs, stuff & risk

Since the darkweb is not indexed by the clearweb search engines finding/discovering hidden services can be difficult. Places where you can find the .onion links are usually Hidden Wikis, Twitter, Reddit, Pastebin, Github and internet forums. You should be able to google search for these links as well.

*A note on hidden wikis – there are many websites that claim to be the hidden wiki and the uncensored Tor hidden wiki – be mindful if/when clicking on here as you can’t always be sure where that exit node is leading to.

As you know, Tor is decentralized by nature, so there is no list of all hidden services, but there are hidden services whose task is to catalog those known .onion addresses.

Such as this.

There are also Torch, Sinbad, and other search engines, but it remains to you to decide how worthy they are.

While we’re on the topic, I’d like to point out that you should always be mindful of the potential risks you’re opening yourself to. Every action counts, and you should take necessary precautions, always.

A good way to illustrate this are the CTFs I participated in, that required us to investigate data collected from Tor that pertains to a slew of illegal activities. The organizers simply didn’t render any content, thus eliminating the risk for us analysts.

You could only see what was relevant for your investigation, be that a hash, bitcoin address, email address, or anything else that was of relevance and scraped to the dataset.

When you’re doing this by yourself, there’s no organizer to filter out stuff for you, so always be mindful of that.

More reflections on Tor and Mitigations

Tor prevents your ISP/local network from knowing what you visited, prevents tracking, and helps with avoiding censorship.

However, the 3-letter agencies dislike Tor; mainly because Tor is the best network for these uses, thus it is always under attack, and when it is, its mostly to deanonymyze its users.

If you’re in locations that might be targeted and risk is high, or your adversary has significant resources, you should not rely on Tor to anonymyze you.

Another big weakness for Tor is you, the user. This is due to you not having good Opsec, which will defeat the purpose of Tor, by default.

Other weaknesses are browser-based attacks, as well as attacks against the host OS.

Of course, you can mitigate and reduce the probability of these attacks and this implies you having some controls implemented.

First and foremost, go back to Opsec basics, learn it inside and out, and create your model.

You should also leverage isolation, compartmentalization/virtualization to reduce the impact and possibility of browser exploits (or other attacks) being successful.

Never install Tor on your main OS, especially if the consequences are high.

Use hardened VMs.

Just running the tor browser in windows is NOT a good idea. Assume the Tor browser is exploitable and mitigate appropriately, use isolation.

Whatever is your isolation, it also needs to be hardened.

To future proof yourself against unknown threats, you need non-persistence; you should not rely on the Tor browser to purge all that data fully reliably. However, you can get this through Tails and other live OSes, VMs or you can use whole disk encryption and secure delete. You can also use combination of these methods to better protect yourself.


Be aware of the design documentation – https://2019.www.torproject.org/projects/torbrowser/design/

Conclusion

I hope I’ve put you on a path down the rabbit hole called Tor! There’s so much more, and I will cover as much as I possibly can.

Stay tuned.

Cover image by JC Gellidon

#tor #risk #tracking #deanonymization

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About VRX
VRX is a consolidated vulnerability management platform that protects assets in real time. Its rich, integrated features efficiently pinpoint and remediate the largest risks to your cyber infrastructure. Resolve the most pressing threats with efficient automation features and precise contextual analysis.

Weapon of Mass Destruction – Voice AI-based Attack

Many people think that getting key personal information can be very hard, but it’s now becoming easier than ever.

Last week, I was reading how Elon Musk let go of thousands of people at Twitter using an AI-based bot that was trained to reproduce a message using the voice of famous people. I find it clownish but VERY dangerous.

This impersonation technology, used in the wrong hands, could lead to someone obtaining critical information about a business. It’s even better than phishing.

Even a combination of both (plus some threat intelligence) could be the perfect weapon to utilize in a malicious campaign.

Imagine this: you record the voice of any C-level position in a company – let’s say Procurement Manager. Train the bot to recognize the voice, and then we call the Finance Manager with it and ask him/her to transfer money to an external party, using a phishing mail which impersonates the Procurement Manager.

Bingo! It’s money in the bank.

In fact, it’s already happening.

There are even more terrible attacks that I won’t describe, but this will be a weapon of mass destruction.

Conclusion: cybersecurity offensive techniques are evolving very quickly and a black hat can do a lot of harm without the right company controls and processes.

My advice:

  1. Check everything twice.
  2. Have the correct processes in place in your company before moving a finger.
  3. Train your workforce, family and friends.

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About VRX
VRX is a consolidated vulnerability management platform that protects assets in real time. Its rich, integrated features efficiently pinpoint and remediate the largest risks to your cyber infrastructure. Resolve the most pressing threats with efficient automation features and precise contextual analysis.

New Subscription Tab

Do you want to view the details of your purchased license? Need to send the license PDF to your CFO? This one is for you. In your dashboard, navigate to Settings -> Subscription. Click the three dots icon at the right to download the report. New and easy license view, just for you!

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About VRX
VRX is a consolidated vulnerability management platform that protects assets in real time. Its rich, integrated features efficiently pinpoint and remediate the largest risks to your cyber infrastructure. Resolve the most pressing threats with efficient automation features and precise contextual analysis.

Choosing the Right Access Control Model

In my previous article, Code security and safety tips when making guidelines, I mentioned that it is very important to give someone access based on the role assigned in your system. I have also mentioned the 3 most widely accepted access control models: Discretionary Access Control (DAC), Mandatory Access Control (MAC), and Permission Based Access Control (PBAC).

Choosing the right access control model for your project/organization is of great importance from a security point of view. With the proper implementation, you can prevent unauthorized access to the resources. Thus, you can prevent possible attacks.

There are more access control models, and I will try to show you their differences. By doing that, I will help you choose the best model for your application. 

How to determine which access control you should give to the user/employee?

First, you would need to identify the person’s job. Then you would need to authenticate them by their identification, and then you would need to grant a person access to the hardware/software they need. By doing that, you must ensure they have the right level of permission to the organization’s resources to do their job. At this stage, you would need to choose the type of access control model.

Main categorization of access control models

There are 6 main types of access control models:

  • Mandatory Access Control (MAC)

  • Discretionary Access Control (DAC)

  • Role-Based Access Control (RBAC)

  • Rule-Based Access Control 

  • Attribute-Based Access Control (ABAC)

  • Risk-Based Access Control

 

Mandatory Access Control – This model gives access controls only to the system’s owner. The end user doesn’t have any rights. The system owner can allow the end user which resources to access. This model has the highest level of restriction compared to the other models.

Because of its restrictive level, this model is used in government facilities and/or the military.

This model is also connected with two security models: Bell-LaPadula and Biba.

Biba allows the user with a lower-level classification to read higher-level info and the user with a higher-level classification to write to lower levels.

Bell-LaPadula allows the user with higher-level classification to write on its level and not on the lower levels, but they can read at lower levels.

If you want to know more about these two security models, check out Bell-LaPadula and Biba video. You can also check out Clark Wilson model, which focuses on upholding integrity.

 

Discretionary Access Control – This model gives all access controls to the user. It is the opposite compared to the MAC. As you can guess, the implementation of this model can lead to many cyber attacks, so you must be very aware of its flaws if you plan to use it.

 

Role-Based Access Control – This model gives predefined permissions based on the employee’s position. This can be tricky to implement if you need to later modify a person’s permissions and provide some specific access to some resource.

 

Rule-Based Access Control – This model gives access control based on rules. The system administrator manages the rules, checks the boxes, or adds some code to the settings. In the web application, this can be implemented in some settings page where you would have, for example, a list of rules, and by each rule you would have some check box. Depending on which of the rules you will check, you can save it and have the rules list you can use to assign to someone/or some custom role, etc. 

 

Attribute-Based Access Control – This model is defined by attributes. Attributes are tightly coupled with subject, object, environment, and actions. This means that we would have a lot of variations based on mentioned attributes, which could lead to increased implementation difficulty/complexity.  

 

Risk-Based Access Control – This model gives access based on risk evaluation. Mainly the profile risk of the user who is going to log in is evaluated. For example, if the user logs in from a different location, the risk is higher, and they will be prompted to further authenticate.

 

Example of implementation of Role-Based Access Control in the web application

For this example, I am going to use the Angular framework. You will see in the code below that I am checking roles in two cases. The first case is when you navigate to a certain page if the user has access to it, and the second is if the user has access but should be permitted to see a certain part of the page, or they have just read rights but not write… 

Create RoleGuard class that will implement the CanActivate interface. As mentioned on the Angular official site, the canActivate method will return true if the route can be activated. It will give the access and false if the requested route cannot be activated. 

As you can see from the code, in local storage, roles were stored, and in the isRoleAssigned method, it is checked whether the user has the required role from the list of roles in the method’s input. If the user has the role, the method will return true, and it will navigate to the required route, and with false, the user will be redirected to the home page, for example (or maybe some custom page).

 

import {
 ActivatedRouteSnapshot,
 CanActivate,
 Router,
} from "@angular/router";
 
@Injectable()
export class RoleGuard implements CanActivate {
 constructor(
  private route: Router,
  private _localStorage: LocalStorageManager
 ) {
  }
 
 public canActivate(route: ActivatedRouteSnapshot): Observable<boolean> | boolean{
  return this.isRoleAssigned(route.data.roles);
 }
 
 private isRoleAssigned(roles: string[]): boolean {
  let assignedRoles = this._localStorage.retrieveObject(
   this._localStorage.roles
  );
  if (assignedRoles.roles.filter(role => roles.includes(role)).length > 0) {
   return true
  } else {
   this.route.navigateByUrl("home");
   return false
  }
 }
}

 

In app.routing.ts, import RoleGuard and as you can see, we are sending in the data, which is a list of roles someone needs to have to get to the wanted route.

 

import { RoleGuard } from "./auth/role.guard";
 
export const routes: Routes = [
…,
 {
  path: "user-statistic-report",
  component: UserStatisticReportComponent,
  data: { title: "User Statistic Report", roles: ["Manager"]},
  canActivate: [AuthGuard, RoleGuard],
 },
…

 

That part explained the routing part. The code below will present the state of the button based on the role.

So, I have implemented the role service in which I get assigned roles. And I am calling it on the page to check whether the user has the required role. For example, are they a Manager or an Admin.

 

 get isManagerOrAdmin() {
  return (
   this.roleService.userRoles &&
   (this.roleService.checkRole(Roles.MANAGER) || this.roleService.checkRole(Roles.ADMINISTRATOR))
  );
 }

 

When the page is initializing, I will call the mentioned method, and based on the outcome, I will enable or disable the button that has the function of saving the report.

 

 ngOnInit(): void {
  if (!this.isManagerOrAdmin) {
    this._buttons.find(x => x.title === "Save report").display = false
  }
…
 }

 

Conclusion

Establishing the model you want to use that is the best for your project/organization is very important. For example, a company with smaller applications will easily implement the Discretionary Access Control model. And other companies whose applications contain highly confidential or sensitive information would prefer to use Role-Based Access Control or Mandatory Access Control models.

I would say put everything “on paper” before you choose the right model; All the requirements your project/organization now has and the ones it could have in the future.

 

Cover photo by Victor Forgacs

#appSec #accessControlModels

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About VRX
VRX is a consolidated vulnerability management platform that protects assets in real time. Its rich, integrated features efficiently pinpoint and remediate the largest risks to your cyber infrastructure. Resolve the most pressing threats with efficient automation features and precise contextual analysis.

×

Hello!

Click one of our contacts below to chat on WhatsApp

×