
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
github.com/m2omou/parser-css
Gocss is a simple css parser written in GO, that provides a way to parse css selectors and properties.
$>go get github.com/m2omou/parser-css/src
import "github.com/m2omou/parser-css/src"
####Type:####
The different type of selector, 'All' stand for the '*' css selector
const (
Class = 1
Id
All
Element
Attribute
)
####Property:####
e.g: "color: white;"
type property struct {
Name string // color
Value string // white
}
####Selector:####
e.g ".container { color: white, float: left }"
type selector struct {
Name string // '.container'
Properties []property // [ { Name : 'color', Value : 'white' }, { Name : 'float', Value : 'left'} ]
Type int // Class
}
fd, err := os.Open("./style.css")
if err != nil {
panic(err)
}
css := parserCSS(fd)
for s := range selectors {
fmt.Println(selectors[s].Name)
for p := range selectors[s].Properties {
fmt.Println(selectors[s].Properties[p].Name + selectors[s].Properties[p].Value)
}
}
For example this css :
body {
width: 100%;
height: 100%;
Background: red;
}
.container {
margin-bottom: 20px;
height: 220px;
width:300px;
font-size: 14px;
}
Will return the following slice :
[
{
"Name":"body",
"Properties":[
{
"Name":"width",
"Value":"100%"
},
{
"Name":"height",
"Value":"100%"
},
{
"Name":"Background",
"Value":"red"
}
],
"Type":1
},
{
"Name":".container",
"Properties":[
{
"Name":"margin-bottom",
"Value":"20px"
},
{
"Name":"height",
"Value":"220px"
},
{
"Name":"width",
"Value":"300px"
},
{
"Name":"font-size",
"Value":"14px"
}
],
"Type":1
}
]
GOCSS Parser Copyright 2014 Mourad Sabour, mourad.sabour[at]gmail.com.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.