
Research
Malicious npm Package Brand-Squats TanStack to Exfiltrate Environment Variables
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.
github.com/gh73962/apple-api-go-client
Advanced tools
Go client library for Apple APIs, including the App Store Server API and Server Notifications.
go get github.com/gh73962/appleapis
First, create a client configuration with your App Store Connect credentials:
package main
import (
"github.com/gh73962/appleapis/appstoreserver/v1"
)
func main() {
opts := []Option{
WithAppAppleID(1234),
WithBundleID("com.example"),
WithEnvironment(EnvironmentProduction),
WithKeyID("your_key_id"),
WithIssuerID("your_issuer_id"),
WithPrivateKey(your_pk),
WithRootCertificates([][]byte{your_cert}),
WithEnableAutoDecode(), // Recommended to be true for most use cases.
}
client, err := New(opts...)
if err != nil {
return nil, err
}
}
ctx := context.Background()
req := &TransactionHistoryRequest{
TransactionID: "1234",
ProductIDs: []string{"com.example.1", "com.example.2"},
ProductTypes: []ProductType{TypeConsumable, TypeAutoRenewableSubscription},
StartDate: time.Now(),
EndDate: time.Now(),
SubscriptionGroupIdentifiers: []string{"sub_group_id", "sub_group_id_2"},
InAppOwnershipType: InAppOwnershipTypeFamilyShared,
Revoked: false,
Revision: "revision_input",
}
req.SetSortASC()
response, err := client.GetTransactionHistory(ctx, req)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Found %d transactions\n", len(response.Payloads))
transactionInfo, err := client.GetTransactionInfo(ctx, "1000000123456789")
if err != nil {
// handle error
}
fmt.Printf("Payload: %+v\n", transactionInfo.Payload)
status, err := client.GetAllSubscriptionStatuses(ctx, "1000000123456789")
if err != nil {
// handle error
}
for _, data := range status.Data {
fmt.Printf("Bundle ID: %s\n", data.BundleID)
for _, transaction := range data.LastTransactions {
fmt.Printf("Status: %s\n", transaction.Status)
}
}
var req appstoreserver.ConsumptionRequest
req.SetSetLifetimeDollarsPurchased(5.99)
req.SetLifetimeDollarsRefunded(5.99)
req.SetAccountTenure(365)
req.SetPlayTime(96*time.Hour)
if err := client.SendConsumptionInfo(ctx, &req); err != nil {
// handle error
}
Handle App Store Server Notifications v2: Ref receiving-app-store-server-notifications
import "github.com/gh73962/appleapis/appstoreservernotifications/v2"
// In your webhook handler
func handleNotification(w http.ResponseWriter, r *http.Request) {
body, err := io.ReadAll(r.Body)
if err != nil {
http.Error(w, "Failed to read body", http.StatusBadRequest)
return
}
var notification appstoreservernotifications.ResponseBody
if err := json.Unmarshal(body, ¬ification); err != nil {
http.Error(w, "Invalid JSON", http.StatusBadRequest)
return
}
decodedPayload, err := client.Verifier.VerifyAndDecodeNotification(notification.SignedPayload)
if err != nil {
http.Error(w, "VerifyAndDecodeNotification", http.StatusBadRequest)
return
}
switch decodedPayload.NotificationType{
case appstoreservernotifications.TypeConsumptionRequest:
// Do
case appstoreservernotifications.TypeRefund
// Do
}
w.WriteHeader(http.StatusOK)
}
Web Service Endpoint list on Apple App Store Server API Documentation
| Option | Description | Required |
|---|---|---|
PrivateKey | Your private key from App Store Connect (.p8 file content) | Yes |
KeyID | Key ID from App Store Connect | Yes |
IssuerID | Issuer ID from App Store Connect | Yes |
BundleID | Your app's bundle identifier | Yes |
Environment | EnvironmentSandbox or EnvironmentProduction | Yes |
AppAppleID | Your app's Apple ID | On Production |
RootCertificates | Custom Apple Root CA certificates | No |
EnableOnlineChecks | Enable online certificate verification | No |
HTTPClient | Custom HTTP client | No |
Run the test suite:
go test ./...
git checkout -b feature/amazing-feature)git commit -m 'feature: your desc')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
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
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.

Research
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.