Feat v0.5.1 chat core (#31)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Successful in 5s
CI/CD / test-go-pg (push) Successful in 2m35s
CI/CD / test-sqlite (push) Successful in 2m49s
CI/CD / build-and-deploy (push) Successful in 1m21s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #31.
This commit is contained in:
2026-03-30 12:42:54 +00:00
committed by xcaliber
parent 2abf406db8
commit 7155aaf663
14 changed files with 1883 additions and 29 deletions

View File

@@ -299,6 +299,38 @@ func (h *PackageHandler) InstallPackage(c *gin.Context) {
}
}
// Unicode security gate — scan all scannable files for invisible/deceptive
// characters before writing anything to the extension store.
scanExts := map[string]bool{".star": true, ".json": true, ".js": true, ".html": true}
for _, f := range zr.File {
if f.FileInfo().IsDir() {
continue
}
ext := strings.ToLower(filepath.Ext(f.Name))
if !scanExts[ext] {
continue
}
rc, err := f.Open()
if err != nil {
continue
}
data, err := io.ReadAll(rc)
rc.Close()
if err != nil {
continue
}
findings := sandbox.ScanSource(string(data), f.Name)
if len(findings) > 0 {
if blocked, reason := sandbox.Verdict(findings); blocked {
c.JSON(http.StatusUnprocessableEntity, gin.H{
"error": "extension_blocked",
"reason": fmt.Sprintf("%s (file: %s)", reason, f.Name),
})
return
}
}
}
// Validate required fields
pkgID, _ := manifest["id"].(string)
title, _ := manifest["title"].(string)