Publish Layerfault synthetic corpus LF-CORPUS-NATIVE-0001
Browse files- LAYERFAULT_CORPUS.json +27 -0
- README.md +61 -0
- SHA256SUMS.json +32 -0
- config.json +6 -0
- layerfault_fixture.c +19 -0
- liblayerfault_fixture.so +0 -0
- modeling_layerfault.py +6 -0
LAYERFAULT_CORPUS.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"candidate_rules": [
|
| 3 |
+
"LF-CORR-CUSTOM-LOADER-NATIVE",
|
| 4 |
+
"LF-NATIVE-DYNAMIC-LOAD",
|
| 5 |
+
"LF-NATIVE-EXEC-CAPABILITY",
|
| 6 |
+
"LF-NATIVE-NETWORK-CAPABILITY",
|
| 7 |
+
"LF-NATIVE-RPATH"
|
| 8 |
+
],
|
| 9 |
+
"corpus_id": "LF-CORPUS-NATIVE-0001",
|
| 10 |
+
"description": "HF-style package with an inert ELF shared library importing dlopen, socket and system, built with $ORIGIN RPATH; custom loader references it via ctypes.",
|
| 11 |
+
"expected_rules": [
|
| 12 |
+
"LF-CODE-CTYPES",
|
| 13 |
+
"LF-PY-NATIVE-LOAD",
|
| 14 |
+
"LF-CORR-HF-LOADER-NATIVE-LOAD"
|
| 15 |
+
],
|
| 16 |
+
"generator": "native.native_capability_library",
|
| 17 |
+
"ground_truth": "synthetic-generated",
|
| 18 |
+
"must_not_rules": [],
|
| 19 |
+
"repo_name": "native-capability-library",
|
| 20 |
+
"repo_type": "model",
|
| 21 |
+
"safety": "inert/canary-only",
|
| 22 |
+
"schema": 1,
|
| 23 |
+
"validation": {
|
| 24 |
+
"kind": "verify-package",
|
| 25 |
+
"target": "."
|
| 26 |
+
}
|
| 27 |
+
}
|
README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- layerfault
|
| 5 |
+
- security-research
|
| 6 |
+
- model-security
|
| 7 |
+
- synthetic
|
| 8 |
+
- adversarial-testing
|
| 9 |
+
extra_gated_prompt: >-
|
| 10 |
+
This repository is a synthetic security-test artifact from the Layerfault
|
| 11 |
+
corpus. It intentionally contains adversarial characteristics (e.g.
|
| 12 |
+
suspicious pickle opcodes, executable-format smuggling, prompt-injection
|
| 13 |
+
strings) designed to exercise security scanner detection rules. It is
|
| 14 |
+
**not** a usable ML model and must never be loaded or executed outside an
|
| 15 |
+
isolated scanner-testing environment. By accepting, you confirm you
|
| 16 |
+
understand this repository is a test fixture, not production model
|
| 17 |
+
weights.
|
| 18 |
+
extra_gated_button_content: I understand this is a security test fixture and accept the risk
|
| 19 |
+
gated: auto
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# native-capability-library
|
| 23 |
+
|
| 24 |
+
> **SECURITY TEST ARTIFACT — DO NOT USE AS A PRODUCTION MODEL**
|
| 25 |
+
|
| 26 |
+
This repository is part of the Layerfault synthetic security corpus.
|
| 27 |
+
It is deliberately constructed to contain security-relevant characteristics for scanner testing.
|
| 28 |
+
|
| 29 |
+
**Corpus ID:** `LF-CORPUS-NATIVE-0001`
|
| 30 |
+
|
| 31 |
+
## Purpose
|
| 32 |
+
|
| 33 |
+
HF-style package with an inert ELF shared library importing dlopen, socket and system, built with $ORIGIN RPATH; custom loader references it via ctypes.
|
| 34 |
+
|
| 35 |
+
## Direct expected Layerfault rules
|
| 36 |
+
|
| 37 |
+
- `LF-CODE-CTYPES`
|
| 38 |
+
- `LF-PY-NATIVE-LOAD`
|
| 39 |
+
- `LF-CORR-HF-LOADER-NATIVE-LOAD`
|
| 40 |
+
|
| 41 |
+
## Candidate rules
|
| 42 |
+
|
| 43 |
+
These are deliberately plausible targets that remain marked as candidates until the exact
|
| 44 |
+
Layerfault build used for certification confirms them.
|
| 45 |
+
|
| 46 |
+
- `LF-CORR-CUSTOM-LOADER-NATIVE`
|
| 47 |
+
- `LF-NATIVE-DYNAMIC-LOAD`
|
| 48 |
+
- `LF-NATIVE-EXEC-CAPABILITY`
|
| 49 |
+
- `LF-NATIVE-NETWORK-CAPABILITY`
|
| 50 |
+
- `LF-NATIVE-RPATH`
|
| 51 |
+
|
| 52 |
+
## Negative-control rules
|
| 53 |
+
|
| 54 |
+
These should remain silent for this corpus item.
|
| 55 |
+
|
| 56 |
+
- None
|
| 57 |
+
|
| 58 |
+
## Safety
|
| 59 |
+
|
| 60 |
+
The corpus uses fake secrets, loopback/`.invalid` network destinations, harmless marker output,
|
| 61 |
+
and synthetic model behavior only. It is intended for static scanning and isolated security testing.
|
SHA256SUMS.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"path": "LAYERFAULT_CORPUS.json",
|
| 4 |
+
"sha256": "93af64fe4af64b67c4d33abb1cc4daa16c5738b41348abb284756415904da7fe",
|
| 5 |
+
"size": 814
|
| 6 |
+
},
|
| 7 |
+
{
|
| 8 |
+
"path": "README.md",
|
| 9 |
+
"sha256": "4fdefe548842f880ee090fca54f4ecb2d670cc5bd8b74c35adc0af02c893080d",
|
| 10 |
+
"size": 1951
|
| 11 |
+
},
|
| 12 |
+
{
|
| 13 |
+
"path": "config.json",
|
| 14 |
+
"sha256": "536650dbb14a220688682ea10d37b08076144e7d8c4d85537979840fb909acf7",
|
| 15 |
+
"size": 132
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"path": "layerfault_fixture.c",
|
| 19 |
+
"sha256": "d61d42edc999bf3f17af35d2024fd790902a1b229a594c14d61ea9d08119a3aa",
|
| 20 |
+
"size": 487
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"path": "liblayerfault_fixture.so",
|
| 24 |
+
"sha256": "a455eb534e588d0757e590037f299a198fb804938d5bdc33f81fcfefe4e0ed57",
|
| 25 |
+
"size": 15784
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"path": "modeling_layerfault.py",
|
| 29 |
+
"sha256": "4e6d2fb67c10fb355c73fa5721b764424e4f1f24301f7a78187d100c4ea20e67",
|
| 30 |
+
"size": 180
|
| 31 |
+
}
|
| 32 |
+
]
|
config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"auto_map": {
|
| 3 |
+
"AutoModel": "modeling_layerfault.LayerfaultNativeFixture"
|
| 4 |
+
},
|
| 5 |
+
"model_type": "layerfault_native_fixture"
|
| 6 |
+
}
|
layerfault_fixture.c
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
#include <dlfcn.h>
|
| 3 |
+
#include <stdlib.h>
|
| 4 |
+
#include <sys/socket.h>
|
| 5 |
+
#include <unistd.h>
|
| 6 |
+
|
| 7 |
+
/*
|
| 8 |
+
* Inert security fixture: capabilities are present in the import table.
|
| 9 |
+
* The function is never called by the generator or validation harness.
|
| 10 |
+
*/
|
| 11 |
+
int layerfault_capability_fixture(void) {
|
| 12 |
+
void *h = dlopen("libc.so.6", RTLD_LAZY);
|
| 13 |
+
if (h) dlclose(h);
|
| 14 |
+
|
| 15 |
+
int fd = socket(AF_INET, SOCK_STREAM, 0);
|
| 16 |
+
if (fd >= 0) close(fd);
|
| 17 |
+
|
| 18 |
+
return system("/bin/echo LAYERFAULT_CANARY >/dev/null");
|
| 19 |
+
}
|
liblayerfault_fixture.so
ADDED
|
Binary file (15.8 kB). View file
|
|
|
modeling_layerfault.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import ctypes
|
| 2 |
+
class LayerfaultNativeFixture:
|
| 3 |
+
@classmethod
|
| 4 |
+
def from_pretrained(cls, *args, **kwargs):
|
| 5 |
+
ctypes.CDLL("./liblayerfault_fixture.so")
|
| 6 |
+
return cls()
|