
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
github.com/mitranim/refut
Short for "reflect utils": utilities missing from the "reflect" package in the Go standard library. Small and dependency-free.
See the full documentation at https://pkg.go.dev/github.com/mitranim/rf.
Walking now avoids stack overflow on cyclic types. More specifically, it avoids infinite recursion when generating walkers for cyclic types. Note that fully walking cyclic types is not yet supported; instead, inner occurrences of a cyclic type are ignored, and only the outermost occurrence is walked. This limitation may be lifted in future versions.
Walking now ignores private fields.
Converted the following tools to generics, for better type safety and efficiency:
TypeFilter
IfaceFilter
ShallowIfaceFilter
Appender
Trawl
TrawlWith
Added KindFilter
(untested).
Added Type
.
Rename WalkFuncPtr
→ WalkPtrFunc
.
Add WalkPtr
and WalkFuncPtr
. Remove DerefPtr
because it made no sense.
Added:
ValueAddr
Interface
DeepFields
TypeDeepFields
OffsetFields
TypeOffsetFields
Path
Rev
Breaking changes:
DerefValue*
to begin with Deref*
.CopyPath
with Path.Copy
.DeepFields
and TypeDeepFields
is a particularly useful addition, as it supports "flattening" structs, simplifying most use cases that involve struct iteration.
Add IfaceFilterFor
, ShallowIfaceFilterFor
.
Reverted breaking change in v0.3.1
: IfaceFilter
once again allows to visit descendants. Added ShallowIfaceFilter
that doesn't visit descendants of a matching node.
Quick breaking change: IfaceFilter
visits either self or descendants, not both.
More flexible Filter
interface:
Previous approach: filter returns bool
answering "should visit this node". 2 possible states. Implicitly walks descendants.
New approach: filter returns flagset where "should visit this node" and "should walk descendants" are both optional flags. 4 possible states. Walking descendants is now optional.
Renamed Filter.ShouldVisit
to Filter.Visit
because it's no longer a boolean. This makes it impossible to implement Filter
and Walker
on the same type, which is probably a good thing due to filter equality rules.
Nop
no longer implements Filter
.
Replaced True
and False
with Self
, Desc
, Both
, All
.
Replaced Not
with InvertSelf
.
Renamed DerefLen
to Len
.
Added Fields
and TypeFields
for micro-optimizing struct shallow walking.
Walk
/ GetWalker
now support walking into interface{}
values, fetching the appropriate cached walker for the given type and filter on the fly.
Added MaybeOr
, MaybeAnd
, GetTypeFilter
, TypeFilterFor
for micro-optimizing filter allocations.
Complete revision.
Cache
for generating and caching arbitrary type-dependent structures.github.com/mitranim/refut
to github.com/mitranim/rf
for brevity.I'm receptive to suggestions. If this library almost satisfies you but needs changes, open an issue or chat me up. Contacts: https://mitranim.com/#contacts
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
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.